Dan Willemsen | d279748 | 2017-07-26 13:13:13 -0700 | [diff] [blame] | 1 | // errorcheck |
| 2 | |
| 3 | // Copyright 2017 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 | |
| 7 | // Check that we don't print duplicate errors for string -> |
| 8 | // array-literal conversion |
| 9 | |
| 10 | package main |
| 11 | |
| 12 | func main() { |
Dan Willemsen | cc753b7 | 2021-08-31 13:25:42 -0700 | [diff] [blame] | 13 | _ = []byte{"foo"} // ERROR "cannot use|incompatible type|cannot convert" |
| 14 | _ = []int{"foo"} // ERROR "cannot use|incompatible type|cannot convert" |
| 15 | _ = []rune{"foo"} // ERROR "cannot use|incompatible type|cannot convert" |
Dan Willemsen | d279748 | 2017-07-26 13:13:13 -0700 | [diff] [blame] | 16 | _ = []string{"foo"} // OK |
| 17 | } |