Russ Cox | f155048 | 2010-03-03 17:23:47 -0800 | [diff] [blame] | 1 | // $G $D/empty.go && errchk $G $D/$F.go |
| 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 | |
Rob Pike | 501f0b5 | 2012-02-23 18:47:26 +1100 | [diff] [blame] | 7 | // Verify that various kinds of "imported and not used" |
| 8 | // errors are caught by the compiler. |
| 9 | // Does not compile. |
Russ Cox | f155048 | 2010-03-03 17:23:47 -0800 | [diff] [blame] | 10 | |
Rob Pike | 501f0b5 | 2012-02-23 18:47:26 +1100 | [diff] [blame] | 11 | package main |
Russ Cox | f155048 | 2010-03-03 17:23:47 -0800 | [diff] [blame] | 12 | |
| 13 | // standard |
| 14 | import "fmt" // ERROR "imported and not used.*fmt" |
| 15 | |
| 16 | // renamed |
| 17 | import X "math" // ERROR "imported and not used.*math" |
| 18 | |
| 19 | // import dot |
| 20 | import . "bufio" // ERROR "imported and not used.*bufio" |
| 21 | |
| 22 | // again, package without anything in it |
| 23 | import "./empty" // ERROR "imported and not used.*empty" |
| 24 | import Z "./empty" // ERROR "imported and not used.*empty" |
| 25 | import . "./empty" // ERROR "imported and not used.*empty" |
| 26 | |