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

Build fails with Go 1.13.4 #106

Closed
atombender opened this issue Dec 3, 2019 · 4 comments
Closed

Build fails with Go 1.13.4 #106

atombender opened this issue Dec 3, 2019 · 4 comments

Comments

@atombender
Copy link

atombender commented Dec 3, 2019

$ go version
go version go1.13.4 darwin/amd64
$ mkdir go
$ export GOPATH=$PWD/go
$ go get -u github.com/amacneil/dbmate
# github.com/amacneil/dbmate
go/src/github.com/amacneil/dbmate/main.go:33:17: 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)
go/src/github.com/amacneil/dbmate/main.go:38:17: 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)
go/src/github.com/amacneil/dbmate/main.go:43:17: 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)
go/src/github.com/amacneil/dbmate/main.go:48:15: 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)
go/src/github.com/amacneil/dbmate/main.go:54:15: cannot use []cli.Command literal (type []cli.Command) as type []*cli.Command in assignment
go/src/github.com/amacneil/dbmate/main.go:138:25: c.GlobalBool undefined (type *cli.Context has no field or method GlobalBool)
go/src/github.com/amacneil/dbmate/main.go:139:23: c.GlobalString undefined (type *cli.Context has no field or method GlobalString)
go/src/github.com/amacneil/dbmate/main.go:140:20: c.GlobalString undefined (type *cli.Context has no field or method GlobalString)
go/src/github.com/amacneil/dbmate/main.go:148:10: c.GlobalString undefined (type *cli.Context has no field or method GlobalString)
@gonzigonz
Copy link

gonzigonz commented Dec 5, 2019

use GO111MODULE=on go get -u github.com/amacneil/dbmate

This is now required as https://github.com/urfave/cli recently changed their api in v2 and without any form of vendoring people would experience this issue. urfave/cli#925

So there are two options (same as discussed in that issue):

  1. change your code to use go modules so you can pin v1, or
  2. update the flag interface for the v2 api changes

dbmate does use go modules to build but installing directly like you are you'll have have to vendor yourself. Option two can easily be done but at the time urfave/cli v2 was still in alpha although I think that has changed now. So the example above is your option 1 solution.

If there is any appetite for an update to use v2 and match the API change I'd be happy to PR

@atombender
Copy link
Author

Thanks. You may want to put this in the readme.

gonzigonz pushed a commit to gonzigonz/dbmate that referenced this issue Dec 14, 2019
- One solution to resolve issue amacneil#106
gonzigonz pushed a commit to gonzigonz/dbmate that referenced this issue Dec 14, 2019
- Alternate solution to resolve issue amacneil#106
@gonzigonz
Copy link

@amacneil let us know if a PR for either of the commits referenced above interest you.

@amacneil
Copy link
Owner

Both commits look good, happy to accept PRs! Thanks

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

3 participants