pcmt/app/settings/helper.go
leo 746eb82f67
All checks were successful
continuous-integration/drone/push Build is passing
go: make sure flags are properly checked
2023-05-04 21:28:30 +02:00

17 lines
232 B
Go

package settings
import "flag"
// as per https://stackoverflow.com/a/54747682.
func isFlagPassed(name string) bool {
found := false
flag.Visit(func(f *flag.Flag) {
if f.Name == name {
found = true
}
})
return found
}