Source file test/fixedbugs/issue48834.go

     1  // errorcheck
     2  
     3  // Copyright 2021 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  package p
     8  
     9  func _() (int, error) {
    10  	return 1 // ERROR "not enough (arguments to return|return values)\n\thave \(number\)\n\twant \(int, error\)"
    11  }
    12  
    13  func _() (int, error) {
    14  	var x int
    15  	return x // ERROR "not enough (arguments to return|return values)\n\thave \(int\)\n\twant \(int, error\)"
    16  }
    17  
    18  func _() int {
    19  	return 1, 2 // ERROR "too many (arguments to return|return values)\n\thave \(number, number\)\n\twant \(int\)"
    20  }
    21  
    22  func _() {
    23  	return 1 // ERROR "too many (arguments to return|return values)\n\thave \(number\)\n\twant \(\)"
    24  }
    25  

View as plain text