Skip to content

Commit

Permalink
add new tag ignore to prevent printing specific field
Browse files Browse the repository at this point in the history
  • Loading branch information
lanphan committed Oct 2, 2024
1 parent 25a2203 commit dad7b53
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/dynamic/print_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ func PrintConfig(s interface{}, f io.Writer, style *table.Style, withColor bool,
continue
}
if jtag := tt.Tag.Get("json"); jtag != "" && jtag != "-" {
if ig := tt.Tag.Get("ignore"); ig == "true" {
continue
}
name := strings.Split(jtag, ",")[0]
if _, ok := redundantSet[name]; ok {
continue
Expand All @@ -106,6 +109,9 @@ func PrintConfig(s interface{}, f io.Writer, style *table.Style, withColor bool,
}
default:
name := strings.Split(jsonTag, ",")[0]
if ig := t.Tag.Get("ignore"); ig == "true" {
continue
}
if _, ok := redundantSet[name]; ok {
continue
}
Expand Down

0 comments on commit dad7b53

Please sign in to comment.