Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Add -no-examples flag to init #472

Closed
sdboyer opened this issue Apr 28, 2017 · 11 comments
Closed

Add -no-examples flag to init #472

sdboyer opened this issue Apr 28, 2017 · 11 comments

Comments

@sdboyer
Copy link
Member

sdboyer commented Apr 28, 2017

Per the spec (#277) and as a follow-up to #462, add a -no-examples flag to dep init that disables injecting commented examples/docs into the created Gopkg.toml.

@EwanValentine
Copy link
Contributor

Happy to pick this up!

@EwanValentine
Copy link
Contributor

EwanValentine commented Apr 28, 2017

Just pulled in the master branch, getting an issue with "github.com/Masterminds/semver" in constraints.go:

type semverConstraint struct {
	c semver.Constraint
}

semver.Constraint is not found, looking at that package, it's a private struct? @sdboyer

@sdboyer
Copy link
Member Author

sdboyer commented Apr 28, 2017

@EwanValentine

Happy to pick this up!

awesome! 🎉

semver.Constraint is not found, looking at that package, it's a private struct?

seems like your vendor isn't populated, for some reason - that arises with semver 1.x/master branch, but dep's Gopkg.toml constrains it to the 2.x branch.

@EwanValentine
Copy link
Contributor

EwanValentine commented Apr 28, 2017

@sdboyer I'm using the constraint "2.x" in the Gopkg.toml, but the lock's showing "v1.2.3". Does dep ensure honour what's in the Gopkg.toml?

UPDATE: Doesn't look like there is a version 2? https://github.com/Masterminds/semver/tags

@sdboyer
Copy link
Member Author

sdboyer commented Apr 28, 2017

@EwanValentine it does, as long as it also appears in the import set. Which...very interestingly...it appears we've recently eliminated, so the constraint is no longer being applied. This is not an uncommon case, but not warning about it makes for a big gotcha; we have #302 opened to address it.

@sdboyer
Copy link
Member Author

sdboyer commented Apr 28, 2017

So...to that end, I'm gonna push a quick change to dep's Gopkg.toml 😄

@EwanValentine
Copy link
Contributor

Ahaaa gotcha! Cool, I'll take another look shortly :)

@sdboyer
Copy link
Member Author

sdboyer commented Apr 28, 2017

OK, master is updated. You shouldn't need to run a dep ensure -update for this PR (if you do, there'll be other problems, but they'll be less problem-y than before 😄 )

@EwanValentine
Copy link
Contributor

Awesome, thank you! That seems to have fixed that issue. I'm getting another issue with the internal package now:

context.go:14:2: use of internal package not allowed
cmd/dep/ensure.go:19:2: use of internal package not allowed

@sdboyer
Copy link
Member Author

sdboyer commented Apr 28, 2017

This is strange things - all of this is code that compiles now.

Oh, wait - are you working on a fork in github.com/EwanValentine/dep, rather than the canonical location of github.com/golang/dep? That'd cause this.

@EwanValentine
Copy link
Contributor

@sdboyer Spot on! Fixed it now, I'm just working in github.com/golang/dep but setting the origin to ewanvalentine/dep. Thanks again for your help!

@sdboyer sdboyer closed this as completed May 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants