lkarlslund/Adalanche

Panic in Ubuntu 18.04.05

Scoubi opened this issue · 2 comments

On a fully updraded Ubuntu 18 I get the following when trying to run adalanche

./adalanche flag redefined: authmode
panic: ./adalanche flag redefined: authmode

goroutine 1 [running]:
flag.(*FlagSet).Var(0xc000032720, 0xa6a280, 0xc000116cf0, 0x9b2964, 0x8, 0x9d0e18, 0x62)
	/usr/local/go/src/flag/flag.go:871 +0x485
flag.(*FlagSet).StringVar(...)
	/usr/local/go/src/flag/flag.go:760
flag.(*FlagSet).String(0xc000032720, 0x9b2964, 0x8, 0x9aedf1, 0x4, 0x9d0e18, 0x62, 0xc000116ce0)
	/usr/local/go/src/flag/flag.go:773 +0xa5
flag.String(...)
	/usr/local/go/src/flag/flag.go:780
main.main()
	/home/msaulnier/adalanche/main.go:93 +0x325

I'm pretty new to Go, but from what I understand authmode is defined twice in the code..

I get the same error regardless of the flags I pass to it.

Thank you.

I get pretty much the same error from OSX

./adalanche 
./adalanche flag redefined: authmode
panic: ./adalanche flag redefined: authmode

goroutine 1 [running]:
flag.(*FlagSet).Var(0xc0000be660, 0x16670e0, 0xc000384d50, 0x15af1f6, 0x8, 0x15cd285, 0x62)
	/usr/local/go/src/flag/flag.go:871 +0x485
flag.(*FlagSet).StringVar(...)
	/usr/local/go/src/flag/flag.go:760
flag.(*FlagSet).String(0xc0000be660, 0x15af1f6, 0x8, 0x15ab692, 0x4, 0x15cd285, 0x62, 0xc000384d40)
	/usr/local/go/src/flag/flag.go:773 +0xa5
flag.String(...)
	/usr/local/go/src/flag/flag.go:780
main.main()
	/Users/e1485/adalanche/main.go:93 +0x325

Yes, it's a bug. I wasn't aware that you weren't allowed to redefine a flag.

I've worked around it with another pattern, so it should work for you now.

Obviously I'm developing this on Windows :-) Thanks for reporting this.