1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-10 03:17:11 +02:00
revive/fixtures/golint
Dian 44eed7edb7 fix error return rule to allow multiple error return values (#110)
* fix error return rule to allow multiple error return values

please check golint related updates here: golang/lint@8379672

When returning multiple values with an error,
lint checks if the error is the last return value.
But the implementation actually is checking for all return values
except for the last one, and throw the alert if it found an error.

There is a (edge) case where some function returning more than one error
is getting a false positive even when the last return value is an error.

This patch adds an early check, to see if the last return value is an error
and if so, it will pass silently.

* Fix return error

* add test changes
2019-03-20 11:54:27 -07:00
..
blank-import-lib.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
const-block.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
context-as-argument.go Refactoring and renaming 2018-05-26 21:28:31 -07:00
context-keys-type.go Refactoring and renaming 2018-05-26 21:28:31 -07:00
docs_test.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
error-naming.go Refactoring and renaming 2018-05-26 21:28:31 -07:00
error-return.go fix error return rule to allow multiple error return values (#110) 2019-03-20 11:54:27 -07:00
error-strings.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
errorf.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
exported.go Fix rule for documentation of exported types (#29) 2018-07-08 08:14:15 +10:00
if-return.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
import-dot.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
increment-decrement.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
indent-error-flow.go Fix issue19 (#20) 2018-06-13 07:01:31 -07:00
package-doc1.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
package-doc2.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
package-doc3.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
package-doc4.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
package-doc5.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
package-main.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
range.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
receiver-naming.go Refactoring and renaming 2018-05-26 21:28:31 -07:00
sort.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
stutter.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
time-naming.go Refactoring and renaming 2018-05-26 21:28:31 -07:00
unexported-return.go Improve tests (#18) 2018-06-11 11:22:06 -07:00
value-spec.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
var-declaration.go Refactoring of the tests 2018-02-04 15:02:45 -08:00
var-naming.go Run var-naming on test files 2018-05-30 17:41:02 -07:00