aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/script_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/script_test.go')
-rw-r--r--src/cmd/go/script_test.go20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go
index fa660bafc8..a38dec3610 100644
--- a/src/cmd/go/script_test.go
+++ b/src/cmd/go/script_test.go
@@ -22,7 +22,6 @@ import (
"path/filepath"
"runtime"
"strings"
- "sync"
"testing"
"time"
@@ -395,32 +394,13 @@ func readCounters(t *testing.T, telemetryDir string) map[string]uint64 {
return totals
}
-//go:embed testdata/counters.txt
-var countersTxt string
-
-var (
- allowedCountersOnce sync.Once
- allowedCounters = map[string]bool{} // Set of allowed counters.
-)
-
func checkCounters(t *testing.T, telemetryDir string) {
- allowedCountersOnce.Do(func() {
- for _, counter := range strings.Fields(countersTxt) {
- allowedCounters[counter] = true
- }
- })
counters := readCounters(t, telemetryDir)
if _, ok := scriptGoInvoked.Load(testing.TB(t)); ok {
if !disabledOnPlatform && len(counters) == 0 {
t.Fatal("go was invoked but no counters were incremented")
}
}
- for name := range counters {
- if !allowedCounters[name] {
- t.Fatalf("incremented counter %q is not in testdata/counters.txt. "+
- "Please update counters_test.go to produce an entry for it.", name)
- }
- }
}
// Copied from https://go.googlesource.com/telemetry/+/5f08a0cbff3f/internal/telemetry/mode.go#122