don't use net.IPMask

net.IPMask doesn't have any advantages, as it would
marshalled to
mask:
  - 1
  - 2
  - 3
  - 4

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2024-07-17 15:47:45 +02:00
committed by Jonathon Anderson
parent 9fdb9ca792
commit c08cd82e68
7 changed files with 46 additions and 43 deletions

View File

@@ -157,20 +157,6 @@ func createFlags(baseCmd *cobra.Command,
net.IP{}, // empty default!
myType.Tag.Get("comment"))
}
} else if myType.Type == reflect.TypeOf(net.IPMask{}) {
ptr := myVal.Addr().Interface().(*net.IPMask)
if myType.Tag.Get("sopt") != "" {
baseCmd.PersistentFlags().IPMaskVarP(ptr,
myType.Tag.Get("lopt"),
myType.Tag.Get("sopt"),
net.IPMask{}, // empty default!
myType.Tag.Get("comment"))
} else {
baseCmd.PersistentFlags().IPMaskVar(ptr,
myType.Tag.Get("lopt"),
net.IPMask{}, // empty default!
myType.Tag.Get("comment"))
}
} else if myType.Type == reflect.TypeOf(wwbool) {
ptr := myVal.Addr().Interface().(*wwtype.WWbool)
if myType.Tag.Get("sopt") != "" {