1
0
mirror of https://github.com/mgechev/revive.git synced 2024-12-12 10:44:59 +02:00
revive/testdata/confusing_results.go
chavacava 98a6c97664
fix: confusing-results doesn't work with pointer types (#1158)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-12-04 17:42:07 +01:00

29 lines
650 B
Go

package fixtures
func getfoo() (int, int, error) { // MATCH /unnamed results of the same type may be confusing, consider using named results/
}
func getBar(a, b int) (int, error, int) {
}
func Getbaz(a string, b int) (int, float32, string, string) { // MATCH /unnamed results of the same type may be confusing, consider using named results/
}
func GetTaz(a string, b int) string {
}
func (t *t) GetTaz(a int, b int) {
}
func namedResults() (a string, b string) {
return "nil", "nil"
}
func pointerResults() (*string, *string) { // MATCH /unnamed results of the same type may be confusing, consider using named results/
return nil, nil
}