github.com/ltltlt/go-source-code@v0.0.0-20190830023027-95be009773aa/go/types/testdata/importdecl0b.src (about) 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 "math" 8 import m "math" 9 10 import . "testing" // declares T in file scope 11 import . /* ERROR "imported but not used" */ "unsafe" 12 import . "fmt" // declares Println in file scope 13 14 import ( 15 // TODO(gri) At the moment, 2 errors are reported because both go/parser 16 // and the type checker report it. Eventually, this test should not be 17 // done by the parser anymore. 18 "" /* ERROR invalid import path */ /* ERROR invalid import path */ 19 "a!b" /* ERROR invalid import path */ /* ERROR invalid import path */ 20 "abc\xffdef" /* ERROR invalid import path */ /* ERROR invalid import path */ 21 ) 22 23 // using "math" in this file doesn't affect its use in other files 24 const Pi0 = math.Pi 25 const Pi1 = m.Pi 26 27 type _ T // use "testing" 28 29 func _() func() interface{} { 30 return func() interface{} { 31 return Println // use "fmt" 32 } 33 }