2018-07-28 18:07:31 +02:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2023-03-15 00:16:12 +01:00
|
|
|
"github.com/mgechev/revive/lint"
|
2018-07-28 18:07:31 +02:00
|
|
|
"github.com/mgechev/revive/rule"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TestStructTag tests struct-tag rule
|
|
|
|
func TestStructTag(t *testing.T) {
|
|
|
|
testRule(t, "struct-tag", &rule.StructTagRule{})
|
|
|
|
}
|
2023-03-15 00:16:12 +01:00
|
|
|
|
|
|
|
func TestStructTagWithUserOptions(t *testing.T) {
|
|
|
|
testRule(t, "struct-tag-useroptions", &rule.StructTagRule{}, &lint.RuleConfig{
|
2023-09-24 08:44:02 +02:00
|
|
|
Arguments: []any{"json,inline,outline", "bson,gnu"},
|
2023-03-15 00:16:12 +01:00
|
|
|
})
|
|
|
|
}
|