Rémy Oudompheng | 46bce2a | 2012-10-07 23:22:01 +0200 | [diff] [blame] | 1 | // Copyright 2009 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Verify that various kinds of "imported and not used" |
| 6 | // errors are caught by the compiler. |
| 7 | // Does not compile. |
| 8 | |
| 9 | package main |
| 10 | |
| 11 | // standard |
| 12 | import "fmt" // ERROR "imported and not used.*fmt" |
| 13 | |
| 14 | // renamed |
| 15 | import X "math" // ERROR "imported and not used.*math" |
| 16 | |
| 17 | // import dot |
| 18 | import . "bufio" // ERROR "imported and not used.*bufio" |
| 19 | |
| 20 | // again, package without anything in it |
Ian Lance Taylor | 449cc06 | 2015-10-06 17:57:46 -0700 | [diff] [blame] | 21 | import "./empty" // ERROR "imported and not used.*empty" |
| 22 | import Z "./empty" // ERROR "imported and not used.*empty" |
Rémy Oudompheng | 46bce2a | 2012-10-07 23:22:01 +0200 | [diff] [blame] | 23 | import . "./empty" // ERROR "imported and not used.*empty" |
| 24 | |