Answers for "golang flagset check to see if arg is available but has no value"

Go
1

golang flagset check to see if arg is available but has no value

func isFlagPassed(name string) bool {
    found := false
    flag.Visit(func(f *flag.Flag) {
        if f.Name == name {
            found = true
        }
    })
    return found
}
Posted by: Guest on April-07-2021

Code answers related to "golang flagset check to see if arg is available but has no value"

Browse Popular Code Answers by Language