Dep: Add -no-examples flag to init

Created on 28 Apr 2017  路  11Comments  路  Source: golang/dep

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.

help wanted good first issue

All 11 comments

Happy to pick this up!

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

@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.

@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

@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.

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

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

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 馃槃 )

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

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.

@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!

Was this page helpful?
0 / 5 - 0 ratings