pmorie / osb-starter-pack

A quickstart for making a new Open Service Broker
Apache License 2.0
69 stars 47 forks source link

Ineffective constraint in Gopkg.toml #46

Closed carolynvs closed 6 years ago

carolynvs commented 6 years ago

If you run dep ensure with the latest version of dep, it will point out that we are setting a constraint that is ignored by dep:

$ dep ensure
Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  gopkg.in/yaml.v2

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies,

Since dep is already properly detecting v2 of the yaml package, that entry can be safely removed.

Or if it's critical that we set that constraint, a dummy import can be added to the code to force dep to enforce the constraint by promoting it to a direct dependency.