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 <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Peter Weinberger <pjw@google.com>
diff --git a/counter/countertest/countertest.go b/counter/countertest/countertest.go index 533f5e5..3f0ad9e 100644 --- a/counter/countertest/countertest.go +++ b/counter/countertest/countertest.go
@@ -8,6 +8,7 @@ import ( "sync" + "testing" "golang.org/x/telemetry/counter" ic "golang.org/x/telemetry/internal/counter" @@ -61,3 +62,10 @@ func ReadFile(name string) (counters, stackCounters map[string]uint64, _ error) { return ic.ReadFile(name) } + +func init() { + // Extra safety check. + if !testing.Testing() { + panic("use of this package is disallowed in non-testing code") + } +}
diff --git a/counter/countertest/countertest_go121.go b/counter/countertest/countertest_go121.go deleted file mode 100644 index 8d117e0..0000000 --- a/counter/countertest/countertest_go121.go +++ /dev/null
@@ -1,16 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.21 - -package countertest - -import "testing" - -func init() { - // Extra safety check for go1.21+. - if !testing.Testing() { - panic("use of this package is disallowed in non-testing code") - } -}
diff --git a/counter/countertest/countertest_test.go b/counter/countertest/countertest_test.go index 2379445..5993230 100644 --- a/counter/countertest/countertest_test.go +++ b/counter/countertest/countertest_test.go
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.21 - package countertest import (
diff --git a/internal/configgen/main.go b/internal/configgen/main.go index 145ffd9..afc9258 100644 --- a/internal/configgen/main.go +++ b/internal/configgen/main.go
@@ -4,8 +4,6 @@ //go:generate go run . -w -//go:build go1.22 - // Package configgen generates the upload config file stored in the config.json // file of golang.org/x/telemetry/config based on the chartconfig stored in // config.txt.
diff --git a/internal/configgen/main_test.go b/internal/configgen/main_test.go index 2651d7a..0d1f82e 100644 --- a/internal/configgen/main_test.go +++ b/internal/configgen/main_test.go
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.22 - package main import (
diff --git a/internal/configgen/syslist.go b/internal/configgen/syslist.go index 6b5012f..d621d74 100644 --- a/internal/configgen/syslist.go +++ b/internal/configgen/syslist.go
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.22 - package main // knownOS is the list of past, present, and future known GOOS values.
diff --git a/internal/configgen/validate.go b/internal/configgen/validate.go index 1652767..6f38362 100644 --- a/internal/configgen/validate.go +++ b/internal/configgen/validate.go
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.22 - package main import (
diff --git a/internal/configgen/validate_test.go b/internal/configgen/validate_test.go index ec6f383..6519eb5 100644 --- a/internal/configgen/validate_test.go +++ b/internal/configgen/validate_test.go
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.22 - package main import (
diff --git a/internal/mmap/mmap_other.go b/internal/mmap/mmap_other.go index 190afd8..610ab1a 100644 --- a/internal/mmap/mmap_other.go +++ b/internal/mmap/mmap_other.go
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (js && wasm) || wasip1 || plan9 || (solaris && !go1.20) +//go:build (js && wasm) || wasip1 || plan9 package mmap
diff --git a/internal/mmap/mmap_unix.go b/internal/mmap/mmap_unix.go index f15ac61..72ad91d 100644 --- a/internal/mmap/mmap_unix.go +++ b/internal/mmap/mmap_unix.go
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build unix && (!solaris || go1.20) +//go:build unix package mmap