Source file test/fixedbugs/bug289.go

     1  // errorcheck
     2  
     3  // Copyright 2010 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  // https://code.google.com/p/gofrontend/issues/detail?id=1
     8  
     9  package main
    10  
    11  func f1() {
    12  	a, b := f() // ERROR "assignment mismatch|does not match|cannot initialize"
    13  	_, _ = a, b
    14  }
    15  
    16  func f2() {
    17  	var a, b int
    18  	a, b = f() // ERROR "assignment mismatch|does not match|cannot assign"
    19  	_, _ = a, b
    20  }
    21  
    22  func f() int {
    23  	return 1
    24  }
    25  

View as plain text