You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver) #925
After the last 2 months there was an error: cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
In commit ebc2565 error not exists.
In corrent master error exists.
Reacted by Jan Garaj, Hussam Dawood, Max Claus, Daniel S., Nathan Coleman, Mingfei Huang, Henry Goddard, juansc, Felix Frank, Gonzalo Lucero and 2 more
I don't think this has enough details to understand the problem.
Do you have a reproduction example, of code that worked and now doesn't?
What go version are you using,? Are you using go modules? Which version of the library you are using?
Stumbled upon that as well. We have code as follows
runFlags := []cli.Flag{
cli.BoolFlag{
Name: flagDownload,
Usage: "download any missing imports (as the get command does)",
},
cli.BoolFlag{
Name: "update",
Usage: "update all dependencies to the latest versions",
},
}
It produces this error message:
lang/gapi.go:79:16: 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)
It looks like everyone's issue here was that they were using this library straight from master, which causes obvious issues whenever we need to release a new major version. The fix here is to do either of the following things:
Activity
AudriusButkevicius commentedon Nov 11, 2019
I don't think this has enough details to understand the problem.
Do you have a reproduction example, of code that worked and now doesn't?
What go version are you using,? Are you using go modules? Which version of the library you are using?
ffrank commentedon Nov 12, 2019
Stumbled upon that as well. We have code as follows
It produces this error message:
HTH!
AudriusButkevicius commentedon Nov 12, 2019
Let me guess, you are not using go modules or any form of vendoring and pull stuff straight from master and build against that?
ffrank commentedon Nov 12, 2019
You know, I had this same question 😅 and our main author has it covered:
https://github.com/purpleidea/mgmt/blob/master/docs/faq.md#why-arent-you-using-glide-godep-or-go-mod-for-dependency-management
I have since been informed that we'll probably need to update this code to match the API change. (On it.)
AudriusButkevicius commentedon Nov 12, 2019
Well this was an intended change to a new version of the API, so I guess you just have to fix your side of things.
We expect potentially one more of these breaking changes next year.
skillful-alex commentedon Nov 12, 2019
ok, but change manual.md , line 547:
saschagrunert commentedon Nov 12, 2019
@skillful-alex please refer to the v2 manual for the latest documentation.
godd9170 commentedon Nov 12, 2019
For any Go noobs out there like me, here's how I repaired my app:
$GO_PATH/src/go mod init github.com/<OWNER>/<REPO>in the root of your app.go run .go get -d -v(Such a as Dockerfile) to usego mod downloadYou can see my commit here: Guestlogix/pat@02d0481
coilysiren commentedon Nov 13, 2019
Oh no! I'm so sorry everyone, we had no idea people were using the package from the
masterbranch.As described above, you'll want to do either of the following things:
go modulesso you can pin v1, orThere's a few things we can do in this repo:
v1=>v2migration guide Create a v1 => v2 migration guide #921v2manualv2is being used by defaultcoilysiren commentedon Nov 14, 2019
@hussamd, @jangaraj, @maxcnunes, @sybnex, @nathancoleman-wf, @max0ne, @juansc if you are still having this issue, can you let me know where you're experiencing it? I'm trying to chase down all of the projects that need to be fixed.
coilysiren commentedon Nov 27, 2019
2nd try ~! @hussamd, @jangaraj, @maxcnunes, @sybnex, @nathancoleman-wf, @max0ne, @juansc if any of you are still experiencing issues, please followup with me!
nathancoleman-wf commentedon Nov 27, 2019
@lynncyrin My team pinned this repo to the last working version a while ago
coilysiren commentedon Nov 28, 2019
Thank for that information!
It looks like everyone's issue here was that they were using this library straight from master, which causes obvious issues whenever we need to release a new major version. The fix here is to do either of the following things:
I'm going to copy paste this a few times on related issues, so that everyone is aware of the solution here.
juansc commentedon Nov 29, 2019
@lynncyrin thanks for the follow up. We also pinned the repo but we'll look at the steps to migrate from v1 to v2.
coilysiren commentedon Nov 29, 2019
I've been compiling migration instructions here => https://github.com/urfave/cli/releases/tag/v2.0.0 ^^