1// errorcheck 2 3// Copyright 2009 The Go Authors. All rights reserved. 4// Use of this source code is governed by a BSD-style 5// license that can be found in the LICENSE file. 6 7// Verify that invalid imports are rejected by the compiler. 8// Does not compile. 9 10package main 11 12// Correct import paths. 13import _ "fmt" 14import _ `time` 15import _ "m\x61th" 16import _ "go/parser" 17 18// Correct import paths, but the packages don't exist. 19// Don't test. 20//import "a.b" 21//import "greek/αβ" 22 23// Import paths must be strings. 24import 42 // ERROR "import path must be a string" 25import 'a' // ERROR "import path must be a string" 26import 3.14 // ERROR "import path must be a string" 27import 0.25i // ERROR "import path must be a string" 28