1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +02:00

fix: nil panic on old go.mod (issue #1100)

This commit is contained in:
centralab
2024-11-08 08:23:28 -03:00
committed by chavacava
parent a4d0c434e1
commit c0d4d07ab6
4 changed files with 132 additions and 0 deletions

22
test/issue1100_test.go Normal file
View File

@@ -0,0 +1,22 @@
package test
import (
"testing"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
func TestIssue1100(t *testing.T) {
args := []any{map[string]any{
"maxLitCount": "2",
"allowStrs": "\"\"",
"allowInts": "0,1,2",
"allowFloats": "0.0,1.0",
"ignoreFuncs": "os\\.(CreateFile|WriteFile|Chmod|FindProcess),\\.Println,ignoredFunc,\\.Info",
}}
testRule(t, "goUnknown/issue1100", &rule.AddConstantRule{}, &lint.RuleConfig{
Arguments: args,
})
}