2012-02-16 21:50:37 -07:00
|
|
|
// errorcheck
|
2012-01-31 15:29:59 -07: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 12:48:36 -07:00
|
|
|
// Verify that invalid imports are rejected by the compiler.
|
2012-02-23 00:47:26 -07:00
|
|
|
// Does not compile.
|
2012-01-31 15:29:59 -07:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
2012-02-24 12:48:36 -07: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-02-09 17:00:23 -07:00
|
|
|
import 42 // ERROR "missing import path; require quoted string"
|
|
|
|
import 'a' // ERROR "missing import path; require quoted string"
|
|
|
|
import 3.14 // ERROR "missing import path; require quoted string"
|
|
|
|
import 0.25i // ERROR "missing import path; require quoted string"
|