mirror of
https://github.com/mgechev/revive.git
synced 2024-11-30 08:57:07 +02:00
b2532b3c33
* Adds rule superfluous-else (an extension of indent-error-flow) * Fix superfluous-else rule struct namming. * Adds superfuous-else rule to the rules table * Adds confusing-naming rule * adds multifile test * clean-up * fix config.go * working version
27 lines
357 B
Go
27 lines
357 B
Go
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/
|
|
}
|
|
|
|
func two(b, c float32) {
|
|
if c>0.0 {
|
|
b = 1 // MATCH /parameter 'b' seems to be modified/
|
|
}
|
|
}
|
|
|
|
type foo struct {
|
|
a string
|
|
}
|
|
|
|
func three(s *foo) {
|
|
s.a = "foooooo"
|
|
}
|
|
|
|
|