Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pokapow opened this issue Jun 19, 2020 · 1 comment

Comments

@pokapow
Copy link

pokapow commented Jun 19, 2020

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
@patdaman
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants