mirror of
https://github.com/mgechev/revive.git
synced 2025-07-17 01:12:27 +02:00
@ -1,9 +1,5 @@
|
|||||||
package fixtures
|
package fixtures
|
||||||
|
|
||||||
import (
|
|
||||||
"go/ast"
|
|
||||||
)
|
|
||||||
|
|
||||||
func one(a int) {
|
func one(a int) {
|
||||||
a, b := 1, 2 // MATCH /parameter 'a' seems to be modified/
|
a, b := 1, 2 // MATCH /parameter 'a' seems to be modified/
|
||||||
a++ // MATCH /parameter 'a' seems to be modified/
|
a++ // MATCH /parameter 'a' seems to be modified/
|
||||||
@ -23,4 +19,7 @@ func three(s *foo) {
|
|||||||
s.a = "foooooo"
|
s.a = "foooooo"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// non regression test for issue 355
|
||||||
|
func issue355(_ *foo) {
|
||||||
|
_ = "foooooo"
|
||||||
|
}
|
||||||
|
@ -37,6 +37,10 @@ func retrieveParamNames(pl []*ast.Field) map[string]bool {
|
|||||||
result := make(map[string]bool, len(pl))
|
result := make(map[string]bool, len(pl))
|
||||||
for _, p := range pl {
|
for _, p := range pl {
|
||||||
for _, n := range p.Names {
|
for _, n := range p.Names {
|
||||||
|
if n.Name == "_" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
result[n.Name] = true
|
result[n.Name] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user