mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
feature: add support for TOML struct tags in struct-tag rule (#1255)
This commit is contained in:
5
testdata/struct_tag.go
vendored
5
testdata/struct_tag.go
vendored
@@ -158,3 +158,8 @@ type ValidateUser struct {
|
||||
BadComplex2 string `validate:"gt=0,dive,eq=1|eq=2,endkeys,required"` // MATCH /option 'endkeys' without a previous 'keys' option in validate tag/
|
||||
BadComplex3 string `validate:"gt=0,dive,keys,eq=1|eq=2,endkeys,endkeys,required"` // MATCH /option 'endkeys' without a previous 'keys' option in validate tag/
|
||||
}
|
||||
|
||||
type TomlUser struct {
|
||||
Username string `toml:"username,omitempty"`
|
||||
Location string `toml:"location,unknown"` // MATCH /unknown option 'unknown' in TOML tag/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user