configstruct: skip items with config:"-"
This commit is contained in:
parent
3280b6b83c
commit
7c51b10d15
1 changed files with 4 additions and 0 deletions
|
@ -116,6 +116,10 @@ func Items(opt interface{}) (items []Item, err error) {
|
|||
fieldType := defType.Field(i)
|
||||
fieldName := fieldType.Name
|
||||
configName, hasTag := fieldType.Tag.Lookup("config")
|
||||
if hasTag && configName == "-" {
|
||||
// Skip items with config:"-"
|
||||
continue
|
||||
}
|
||||
if !hasTag {
|
||||
configName = camelToSnake(fieldName)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue