Skip to content

Commit a66adaf

Browse files
committed
fix: Allow setting STUN to an empty string
This allows users to entirely disable STUN.
1 parent a2ba69d commit a66adaf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cli/cliflag/cliflag.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ func StringVarP(flagset *pflag.FlagSet, p *string, name string, shorthand string
4040
func StringArrayVarP(flagset *pflag.FlagSet, ptr *[]string, name string, shorthand string, env string, def []string, usage string) {
4141
val, ok := os.LookupEnv(env)
4242
if ok {
43-
def = strings.Split(val, ",")
43+
if val == "" {
44+
def = []string{}
45+
} else {
46+
def = strings.Split(val, ",")
47+
}
4448
}
4549
flagset.StringArrayVarP(ptr, name, shorthand, def, usage)
4650
}

0 commit comments

Comments
 (0)