sanathp / statusok

Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected.
Other
1.62k stars 197 forks source link

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

Open pokapow opened 4 years ago

pokapow commented 4 years ago

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 commented 3 years ago

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

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