...
Run Format

Text file src/go/types/testdata/importdecl0a.src

Documentation: go/types/testdata

     1	// Copyright 2013 The Go Authors. All rights reserved.
     2	// Use of this source code is governed by a BSD-style
     3	// license that can be found in the LICENSE file.
     4	
     5	package importdecl0
     6	
     7	import ()
     8	
     9	import (
    10		// we can have multiple blank imports (was bug)
    11		_ "math"
    12		_ "net/rpc"
    13		init /* ERROR "cannot declare init" */ "fmt"
    14		// reflect defines a type "flag" which shows up in the gc export data
    15		"reflect"
    16		. /* ERROR "imported but not used" */ "reflect"
    17	)
    18	
    19	import "math" /* ERROR "imported but not used" */
    20	import m /* ERROR "imported but not used as m" */ "math"
    21	import _ "math"
    22	
    23	import (
    24		"math/big" /* ERROR "imported but not used" */
    25		b /* ERROR "imported but not used" */ "math/big"
    26		_ "math/big"
    27	)
    28	
    29	import "fmt"
    30	import f1 "fmt"
    31	import f2 "fmt"
    32	
    33	// reflect.flag must not be visible in this package
    34	type flag int
    35	type _ reflect /* ERROR "not exported" */ .flag
    36	
    37	// imported package name may conflict with local objects
    38	type reflect /* ERROR "reflect already declared" */ int
    39	
    40	// dot-imported exported objects may conflict with local objects
    41	type Value /* ERROR "Value already declared through dot-import of package reflect" */ struct{}
    42	
    43	var _ = fmt.Println // use "fmt"
    44	
    45	func _() {
    46		f1.Println() // use "fmt"
    47	}
    48	
    49	func _() {
    50		_ = func() {
    51			f2.Println() // use "fmt"
    52		}
    53	}

View as plain text