1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-10 03:17:11 +02:00
revive/fixtures
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
..
golint fix error return rule to allow multiple error return values (#110) 2019-03-20 11:54:27 -07:00
add-constant.go add-constant (new rule) (#39) 2018-07-17 12:21:27 -07:00
argument-limit.go Add tests for the arguments limit 2018-02-04 15:10:35 -08:00
atomic.go New rule: atomic (#77) 2018-10-01 12:24:17 -07:00
bool-literal-in-expr.go bool-literal-in-expr (new rule) (#54) 2018-08-23 11:10:17 -07:00
call-to-gc.go call-to-gc (new rule) (#90) 2018-10-31 07:32:23 -07:00
confusing-naming1.go New rule: Confusing naming (#16) 2018-07-02 12:05:20 +10:00
confusing-naming2.go New rule: Confusing naming (#16) 2018-07-02 12:05:20 +10:00
confusing-results.go New rule: confusing-results (#27) 2018-07-02 12:09:58 +10:00
constant-logical-expr.go constant-logical-expr (new rule) (#55) 2018-08-23 11:45:10 -07:00
cyclomatic-2.go Improve comments 2018-01-26 19:52:29 -08:00
cyclomatic.go Improve comments 2018-01-26 19:52:29 -08:00
deep-exit.go New rule deep-exit (#26) 2018-06-27 06:21:03 +10:00
disable-annotations2.go Fix 102 (#103) 2019-01-24 09:14:43 -08:00
disable-annotations.go Update the documentation for comment annotations 2018-06-01 10:54:30 -07:00
duplicated-imports.go New rule: duplicated-imports (#111) 2019-03-20 11:54:03 -07:00
empty-block.go empty-block: ignore checking blocks of funcs and func literals (#17) 2018-06-11 12:08:58 -07:00
empty-lines.go Fix the same-line comments detection in the empty-lines rule 2018-10-13 09:47:29 -07:00
flag-param.go flag-parameter (new rule) (#44) 2018-07-21 22:58:48 -07:00
function-result-limit.go Rename rule return-argument-limit to function-result-limit 2018-09-17 17:06:53 +08:00
get-return.go New rule: get-return (#23) 2018-06-22 21:21:09 +10:00
imports-blacklist.go Add the imports-blacklist rule (#68) 2018-09-17 13:06:42 -07:00
line-length-limit.go fixes issue #98 (#99) 2019-01-18 07:33:40 -08:00
lint-file-header1.go Add extra rule 2018-02-04 14:51:19 -08:00
lint-file-header2.go Add extra rule 2018-02-04 14:51:19 -08:00
lint-file-header3.go Add extra rule 2018-02-04 14:51:19 -08:00
lint-file-header4.go Add extra rule 2018-02-04 14:51:19 -08:00
lint-file-header5.go Add extra rule 2018-02-04 14:51:19 -08:00
max-public-structs.go Add new rule 2018-02-02 13:32:03 -05:00
modifies-param.go New rule: modifies-parameter (#25) 2018-06-24 17:26:21 +10:00
modifies-value-receiver.go modifies-value-receiver (new rule) (#51) 2018-08-13 15:18:28 -07:00
range-val-in-closure.go Rename rule range-loop-var to range-val-in-closure. 2018-09-29 11:32:32 +08:00
redefines-builtin-id.go redefines-builtin-id (new rule) (#60) 2018-09-13 19:19:49 -07:00
struct-tag.go struct-tag: add support for asn1 and bson (#49) 2018-08-07 11:28:45 -07:00
superfluous-else.go superfuous-else handles more cases (#24) 2018-06-24 17:24:50 +10:00
unnecessary-stmt.go unnecessary-stmt (new rule) (#45) 2018-07-27 22:38:39 -07:00
unreachable-code.go New rule: unreachable-code (#38) 2018-07-16 14:23:47 -07:00
unused-param.go New rule: unused-parameter (#28) 2018-07-07 18:40:02 +10:00
var-naming.go Add white & black lists for var-naming 2018-09-15 15:05:31 -07:00
waitgroup-by-value.go Rename rule name waitgroup-by-copy to waitgroup-by-value 2018-10-03 16:01:41 +08:00