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 get package #556

Closed
dtn97 opened this issue Nov 9, 2019 · 8 comments
Closed

Cannot get package #556

dtn97 opened this issue Nov 9, 2019 · 8 comments
Labels

Comments

@dtn97
Copy link

dtn97 commented Nov 9, 2019

I have an error when get package on Macos: go get -u github.com/swaggo/swag/cmd/swag

github.com/swaggo/swag/cmd/swag

../github.com/swaggo/swag/cmd/swag/main.go:24:16: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../github.com/swaggo/swag/cmd/swag/main.go:29:16: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../github.com/swaggo/swag/cmd/swag/main.go:34:16: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../github.com/swaggo/swag/cmd/swag/main.go:39:16: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../github.com/swaggo/swag/cmd/swag/main.go:44:14: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
../github.com/swaggo/swag/cmd/swag/main.go:48:14: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
../github.com/swaggo/swag/cmd/swag/main.go:52:16: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../github.com/swaggo/swag/cmd/swag/main.go:83:15: cannot use []cli.Command literal (type []cli.Command) as type []*cli.Command in assignment

Please help me how to fix it. Thanks

@francisco-serrano
Copy link

also happening on Windows

@phannam1412
Copy link

phannam1412 commented Nov 11, 2019

root cause: there is a breaking change in https://github.com/urfave/cli (v1 -> v2) that use pointer receiver for StringFlag that cause this compiler error, reverting back to urfave/cli v1.22.1 may solve the issue, I'm wondering how golang manage dependencies between libs

@phannam1412
Copy link

phannam1412 commented Nov 11, 2019

I have figured it out, just run $ git clone https://github.com/swaggo/swag.git && cd swag && go build -o swag cmd/swag to build the executable file, no more issues

@ubogdan
Copy link
Contributor

ubogdan commented Nov 11, 2019

There is an issue with make lint only and with go1.10, I'm waiting for @easonlin404 answer about how he wants to get it fixed. Anyway even if I push a PR with a fix, I still need a team member to approve it.
@dtn97 please clone the repo with git clone git@github.com:swaggo/swag.git and execute make build

@jiangxianzeng
Copy link

also happening on Mac OS

go version go1.13.4 darwin/amd64

@feildrixliemdra
Copy link

feildrixliemdra commented Nov 13, 2019

this issue already fixed?

@easonlin404
Copy link
Member

@feildrixliemdra This is a temp solution because we prefer to use urfave/cli v2.0 after they have a migration doc and migrate to v2.
Yes, for now, this is work to fixed by #557.

@anancds
Copy link

anancds commented Sep 17, 2020

I have figured it out, just run $ git clone https://github.com/swaggo/swag.git && cd swag && go build -o swag cmd/swag to build the executable file, no more issues

it solved my problem,thks

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

No branches or pull requests

8 participants