statusok
statusok copied to clipboard
Cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal
We try to build source, I got this error:
$ go build
# ~/statusok
./statusok.go:40:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./statusok.go:45:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./statusok.go:52:13: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in assignment
You need to add the '&' symbol before "cli.StringFlag"
&cli.StringFlag{
Name: "config",
...
},
&cli.StringFlag{
Name: "log",
...
},