statusok icon indicating copy to clipboard operation
statusok copied to clipboard

Cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal

Open pokapow opened this issue 4 years ago • 1 comments

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

pokapow avatar Jun 19 '20 22:06 pokapow

You need to add the '&' symbol before "cli.StringFlag"

		&cli.StringFlag{
			Name:  "config",
                        ...
		},
		&cli.StringFlag{
			Name:  "log",
                        ...
		},

patdaman avatar Nov 10 '20 23:11 patdaman