diff options
Diffstat (limited to 'src/pkg/go/printer/testdata/declarations.go')
-rw-r--r-- | src/pkg/go/printer/testdata/declarations.go | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/src/pkg/go/printer/testdata/declarations.go b/src/pkg/go/printer/testdata/declarations.go index 309caf3b6..3865a4319 100644 --- a/src/pkg/go/printer/testdata/declarations.go +++ b/src/pkg/go/printer/testdata/declarations.go @@ -7,10 +7,10 @@ package imports import "io" import ( - a "io" + _ "io" ) -import a "io" +import _ "io" import ( "io"; @@ -25,4 +25,50 @@ import ( c "i" "o"; ) +func _() { + // the following decls need a semicolon at the end + type _ int; + type _ *int; + type _ []int; + type _ map[string]int; + type _ chan int; + type _ func() int; + + var _ int; + var _ *int; + var _ []int; + var _ map[string]int; + var _ chan int; + var _ func() int; + + // the following decls don't need a semicolon at the end + type _ struct{} + type _ *struct{} + type _ []struct{} + type _ map[string]struct{} + type _ chan struct{} + type _ func() struct{} + + type _ interface{} + type _ *interface{} + type _ []interface{} + type _ map[string]interface{} + type _ chan interface{} + type _ func() interface{} + + var _ struct{} + var _ *struct{} + var _ []struct{} + var _ map[string]struct{} + var _ chan struct{} + var _ func() struct{} + + var _ interface{} + var _ *interface{} + var _ []interface{} + var _ map[string]interface{} + var _ chan interface{} + var _ func() interface{} +} + // TODO(gri) add more test cases |