1
0
mirror of https://github.com/golang/go synced 2024-11-12 04:40:22 -07:00
go/test/map1.go
Russ Cox 57eb06fe93 test: use testlib (final 61)
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$A\.out *$;// run;g
X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5671080
2012-02-16 23:51:04 -05:00

42 lines
730 B
Go

// errorcheck
// Copyright 2011 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.
package main
func main() {}
type v bool
var (
// valid
_ map[int8]v
_ map[uint8]v
_ map[int16]v
_ map[uint16]v
_ map[int32]v
_ map[uint32]v
_ map[int64]v
_ map[uint64]v
_ map[int]v
_ map[uint]v
_ map[uintptr]v
_ map[float32]v
_ map[float64]v
_ map[complex64]v
_ map[complex128]v
_ map[bool]v
_ map[string]v
_ map[chan int]v
_ map[*int]v
_ map[struct{}]v
_ map[[10]int]v
// invalid
_ map[[]int]v // ERROR "invalid map key"
_ map[func()]v // ERROR "invalid map key"
_ map[map[int]int]v // ERROR "invalid map key"
)