2012-02-16 23:50:37 -05:00
|
|
|
// errorcheck
|
2012-01-31 17:29:59 -05:00
|
|
|
|
|
|
|
// Copyright 2009 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.
|
|
|
|
|
2012-02-24 14:48:36 -05:00
|
|
|
// Verify that invalid imports are rejected by the compiler.
|
2012-02-23 18:47:26 +11:00
|
|
|
// Does not compile.
|
2012-01-31 17:29:59 -05:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
2012-02-24 14:48:36 -05:00
|
|
|
// Correct import paths.
|
|
|
|
import _ "fmt"
|
|
|
|
import _ `time`
|
|
|
|
import _ "m\x61th"
|
|
|
|
import _ "go/parser"
|
|
|
|
|
|
|
|
// Correct import paths, but the packages don't exist.
|
|
|
|
// Don't test.
|
|
|
|
//import "a.b"
|
|
|
|
//import "greek/αβ"
|
|
|
|
|
|
|
|
// Import paths must be strings.
|
2017-03-24 11:43:08 -07:00
|
|
|
import 42 // ERROR "import path must be a string"
|
|
|
|
import 'a' // ERROR "import path must be a string"
|
|
|
|
import 3.14 // ERROR "import path must be a string"
|
|
|
|
import 0.25i // ERROR "import path must be a string"
|