To distinguish when the flag got default value because user didnt set any or user explicitly set the flag to same value as the default value.
You can use Changed func to check it:
if cmd.Flags().Changed("someFlag") {
// user set the flag
}
Thanks! That worked.
Most helpful comment
You can use Changed func to check it: