This commit is contained in:
Lan Phan 2024-09-19 09:41:03 +08:00 committed by GitHub
commit a6c1337493
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,6 +91,10 @@ func PrintConfig(s interface{}, f io.Writer, style *table.Style, withColor bool,
continue
}
if jtag := tt.Tag.Get("json"); jtag != "" && jtag != "-" {
unprintable := tt.Tag.Get("unprintable")
if unprintable == "true" {
continue
}
name := strings.Split(jtag, ",")[0]
if _, ok := redundantSet[name]; ok {
continue
@ -106,6 +110,10 @@ func PrintConfig(s interface{}, f io.Writer, style *table.Style, withColor bool,
}
default:
name := strings.Split(jsonTag, ",")[0]
unprintable := t.Tag.Get("unprintable")
if unprintable == "true" {
continue
}
if _, ok := redundantSet[name]; ok {
continue
}