Source file test/fixedbugs/issue8438.go

     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() {
    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"
    16  	_ = []string{"foo"} // OK
    17  }
    18  

View as plain text