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

Fix cli package compatibility #7

Merged
merged 2 commits into from
Jan 6, 2020

Conversation

teddywing
Copy link
Contributor

Recently, the following errors have come up when building:

$ go build
# github.com/ksubedi/gomove
./main.go:18:5: app.Author undefined (type *cli.App has no field or method Author)
./main.go:21: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)
./main.go:26: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)
./main.go:30: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)
./main.go:37:13: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in assignment

The github.com/codegangsta/cli package has been moved to
github.com/urfave/cli.

The latest major version of github.com/urfave/cli is now v2, which is
incompatible with the version gomove expects.

Add Go Modules manifest files with:

$ go mod init

to set a dependency on github.com/urfave/cli v1, fixing the build
errors.

Also takes care of Println warnings causing go test to fail on Go >= 1.10.

Fixes #6.

Recently, the following errors have come up when building:

    $ go build
    # github.com/ksubedi/gomove
    ./main.go:18:5: app.Author undefined (type *cli.App has no field or method Author)
    ./main.go:21: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)
    ./main.go:26: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)
    ./main.go:30: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)
    ./main.go:37:13: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in assignment

The `github.com/codegangsta/cli` package has been moved to
`github.com/urfave/cli`.

The latest major version of `github.com/urfave/cli` is now v2, which is
incompatible with the version `gomove` expects.

Add Go Modules manifest files with:

    $ go mod init

to set a dependency on `github.com/urfave/cli` v1, fixing the build
errors.

Fixes KSubedi#6.
Was getting the following warnings, causing tests to fail:

    $ go test ./...
    # github.com/ksubedi/gomove
    ./ast.go:67:3: Println arg list ends with redundant newline
    ./ast.go:73:3: Println arg list ends with redundant newline
    ./native.go:112:3: Println arg list ends with redundant newline
    ./native.go:121:3: Println arg list ends with redundant newline
    FAIL	github.com/ksubedi/gomove [build failed]
    FAIL

Since Go 1.10, `go test` runs `vet` checks:
golang/go#18085

Update the print calls to eliminate the `vet` warnings.
Copy link

@EtherCoreAdmin EtherCoreAdmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@KSubedi KSubedi merged commit e1fa472 into KSubedi:master Jan 6, 2020
@KSubedi
Copy link
Owner

KSubedi commented Jan 6, 2020

Merged, thanks for the contribution.

@teddywing
Copy link
Contributor Author

Thanks for the merge!

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

Successfully merging this pull request may close these issues.

Can't install latest
3 participants