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

Update to more recent version of codegangsta/cli #77

Closed
langston-barrett opened this issue Apr 20, 2016 · 2 comments
Closed

Update to more recent version of codegangsta/cli #77

langston-barrett opened this issue Apr 20, 2016 · 2 comments

Comments

@langston-barrett
Copy link
Contributor

langston-barrett commented Apr 20, 2016

When updating glide.yaml to use cli version 1.2.0 and attempting to build goss, I get the following error:

# github.com/aelsabbahy/goss
../../add.go:19: c.Duration undefined (type *cli.Context has no field or method Duration)
../../validate.go:26: c.GlobalIsSet undefined (type *cli.Context has no field or method GlobalIsSet)

Distributive uses a more recent version, so I can't take advantage of certain paths in goss code until this is fixed. I'll look into it.

For reference, the current pinned commit is from 2015:

$ git show 70e3fa51ebed95df8c0fbe1519c1c1f9bc16bb13
commit 70e3fa51ebed95df8c0fbe1519c1c1f9bc16bb13
Merge: f445c89 3463964
Author: Jesse Szwedko <[email protected]>
Date:   Thu Oct 29 20:11:27 2015 -0700
@langston-barrett
Copy link
Contributor Author

Strangely, looks like master has those functions:
https://godoc.org/github.com/codegangsta/cli#Context.Duration

@aelsabbahy
Copy link
Member

aelsabbahy commented Apr 21, 2016

My recommendation would be to remove cli.Context from places it doesn't need to be.

So for example:

func (sys *System) detectPackage(c *cli.Context)

could be refactored as:

func (sys *System) detectPackage(forcePkg string)

For more complex cases, maybe use a config struct that has a collection of attributes in-place of cli.Context

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 a pull request may close this issue.

2 participants