2012-02-17 04:50:37 +00:00
|
|
|
// errorcheck
|
2012-01-31 22:29:59 +00: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 19:48:36 +00:00
|
|
|
// Verify that invalid imports are rejected by the compiler.
|
2012-02-23 07:47:26 +00:00
|
|
|
// Does not compile.
|
2012-01-31 22:29:59 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
2012-02-24 19:48:36 +00: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 18:43:08 +00: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"
|