aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vet/testdata/composite.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/vet/testdata/composite.go')
-rw-r--r--src/cmd/vet/testdata/composite.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/vet/testdata/composite.go b/src/cmd/vet/testdata/composite.go
index 69e7d7ccb0..0355c0b692 100644
--- a/src/cmd/vet/testdata/composite.go
+++ b/src/cmd/vet/testdata/composite.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.
-// This file contains tests for the untagged struct literal checker.
-
// This file contains the test for untagged struct literals.
package testdata
@@ -11,6 +9,7 @@ package testdata
import (
"flag"
"go/scanner"
+ "unicode"
)
var Okay1 = []string{
@@ -57,6 +56,11 @@ var BadStructLiteralUsedInTests = flag.Flag{ // ERROR "unkeyed fields"
"DefValue",
}
+// SpecialCase is an (aptly named) slice of CaseRange to test issue 9171.
+var GoodNamedSliceLiteralUsedInTests = unicode.SpecialCase{
+ {Lo: 1, Hi: 2},
+}
+
// Used to test the check for slices and arrays: If that test is disabled and
// vet is run with --compositewhitelist=false, this line triggers an error.
// Clumsy but sufficient.