mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
Update main.go
This commit is contained in:
19
main.go
19
main.go
@@ -11,26 +11,25 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
src := `
|
src := `
|
||||||
package p
|
package p
|
||||||
|
|
||||||
func Test() {
|
func Test() {
|
||||||
if true {
|
if true {
|
||||||
return 42;
|
return 42;
|
||||||
} else {
|
} else {
|
||||||
return 23;
|
return 23;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func foo_bar(a int, b int, c int, d int) {
|
func foo_bar(a int, b int, c int, d int) {
|
||||||
return a + b + c;
|
return a + b + c;
|
||||||
}
|
}`
|
||||||
`
|
|
||||||
|
|
||||||
revive := lint.New(func(file string) ([]byte, error) {
|
revive := lint.New(func(file string) ([]byte, error) {
|
||||||
return []byte(src), nil
|
return []byte(src), nil
|
||||||
})
|
})
|
||||||
var result []lint.Rule
|
var result []lint.Rule
|
||||||
result = append(result, &rule.LintElseRule{}, &rule.ArgumentsLimitRule{}, &rule.NamesRule{})
|
result = append(result, &rule.ElseRule{}, &rule.ArgumentsLimitRule{}, &rule.NamesRule{})
|
||||||
|
|
||||||
var config = lint.RulesConfig{
|
var config = lint.RulesConfig{
|
||||||
"argument-limit": lint.RuleConfig{
|
"argument-limit": lint.RuleConfig{
|
||||||
|
|||||||
Reference in New Issue
Block a user