Skip to content

Commit 98a4f3d

Browse files
dmitshurgopherbot
authored andcommitted
all: clean up old go build constraints
The go directive in all 3 go.mod files is 1.23.0, so build constraints go1.20, go1.21, and go1.22 are always satisfied. No need to check them. Change-Id: I8c34a0fcc3486f6561aa4013d4bb9ce284f4d57d Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/673275 Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Peter Weinberger <[email protected]>
1 parent 6ae79f5 commit 98a4f3d

File tree

10 files changed

+10
-30
lines changed

10 files changed

+10
-30
lines changed

counter/countertest/countertest.go

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package countertest
88

99
import (
1010
"sync"
11+
"testing"
1112

1213
"golang.org/x/telemetry/counter"
1314
ic "golang.org/x/telemetry/internal/counter"
@@ -61,3 +62,10 @@ func ReadStackCounter(c *counter.StackCounter) (stackCounts map[string]uint64, _
6162
func ReadFile(name string) (counters, stackCounters map[string]uint64, _ error) {
6263
return ic.ReadFile(name)
6364
}
65+
66+
func init() {
67+
// Extra safety check.
68+
if !testing.Testing() {
69+
panic("use of this package is disallowed in non-testing code")
70+
}
71+
}

counter/countertest/countertest_go121.go

-16
This file was deleted.

counter/countertest/countertest_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build go1.21
6-
75
package countertest
86

97
import (

internal/configgen/main.go

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
//go:generate go run . -w
66

7-
//go:build go1.22
8-
97
// Package configgen generates the upload config file stored in the config.json
108
// file of golang.org/x/telemetry/config based on the chartconfig stored in
119
// config.txt.

internal/configgen/main_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build go1.22
6-
75
package main
86

97
import (

internal/configgen/syslist.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build go1.22
6-
75
package main
86

97
// knownOS is the list of past, present, and future known GOOS values.

internal/configgen/validate.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build go1.22
6-
75
package main
86

97
import (

internal/configgen/validate_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build go1.22
6-
75
package main
86

97
import (

internal/mmap/mmap_other.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build (js && wasm) || wasip1 || plan9 || (solaris && !go1.20)
5+
//go:build (js && wasm) || wasip1 || plan9
66

77
package mmap
88

internal/mmap/mmap_unix.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build unix && (!solaris || go1.20)
5+
//go:build unix
66

77
package mmap
88

0 commit comments

Comments
 (0)