mirror of
https://github.com/mgechev/revive.git
synced 2025-07-15 01:04:40 +02:00
@ -1,26 +1,25 @@
|
||||
package fixtures
|
||||
|
||||
import (
|
||||
"go/ast"
|
||||
)
|
||||
|
||||
func one(a int) {
|
||||
a,b:= 1,2 // MATCH /parameter 'a' seems to be modified/
|
||||
a++ // 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/
|
||||
}
|
||||
|
||||
func two(b, c float32) {
|
||||
if c>0.0 {
|
||||
b = 1 // MATCH /parameter 'b' seems to be modified/
|
||||
}
|
||||
if c > 0.0 {
|
||||
b = 1 // MATCH /parameter 'b' seems to be modified/
|
||||
}
|
||||
}
|
||||
|
||||
type foo struct {
|
||||
a string
|
||||
a string
|
||||
}
|
||||
|
||||
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))
|
||||
for _, p := range pl {
|
||||
for _, n := range p.Names {
|
||||
if n.Name == "_" {
|
||||
continue
|
||||
}
|
||||
|
||||
result[n.Name] = true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user