]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: make two related panic messages more consistent
authorDmitri Shuralyov <dmitshur@golang.org>
Sat, 20 May 2023 03:20:43 +0000 (23:20 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 24 May 2023 17:40:18 +0000 (17:40 +0000)
In contrast to the HasSuffix argument, there's no need or benefit in
having a ":" before the "racebench" variant mentioned in the message.
(The variant comes after the colon separator—it doesn't include it.)

Change-Id: Ie9948104de9449422037bf39245944255b98f1b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/497735
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/dist/test.go

index 849dad3640949b43f31fb0dc80649d3e92080d13..3384149391575da9bcbc133e56300738910ec09a 100644 (file)
@@ -834,7 +834,7 @@ func (t *tester) addTest(name, heading string, fn func(*distTest) error) {
        if !strings.Contains(name, ":") && heading != "Testing packages." {
                panic("empty variant is reserved exclusively for registerStdTest")
        } else if strings.HasSuffix(name, ":racebench") && heading != "Running benchmarks briefly." {
-               panic(":racebench variant is reserved exclusively for registerRaceBenchTest")
+               panic("racebench variant is reserved exclusively for registerRaceBenchTest")
        }
        if t.testNames == nil {
                t.testNames = make(map[string]bool)