openware / pkg

Openware go packages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding string vars for commands/subcommands (not a cli) results in a crash

dnfd opened this issue · comments

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x4fda8c]

goroutine 1 [running]:
flag.(*FlagSet).Var(0x0, 0x6cddd0, 0xc000059460, 0x6832bc, 0x4, 0x689822, 0x1a)
	/usr/lib/go/src/flag/flag.go:862 +0x10c
flag.(*FlagSet).StringVar(...)
	/usr/lib/go/src/flag/flag.go:760
github.com/openware/pkg/kli.(*Command).StringFlag(0xc0001541b0, 0x6832bc, 0x4, 0x689822, 0x1a, 0xc000059460, 0xc00007b080)
	/home/den/go/pkg/mod/github.com/openware/pkg@v0.0.0-20211005134515-d7a0eb0b3988/kli/command.go:205 +0x6f