You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
*[Why did `dep ensure -update` not update package X?](#why-did-dep-ensure--update-not-update-package-x)
14
13
*[Why is `dep` ignoring the version specified in the manifest?](#why-is-dep-ignoring-the-version-specified-in-the-manifest)
14
+
*[Why did `dep ensure -update` not update package X?](#why-did-dep-ensure--update-not-update-package-x)
15
15
*[`dep` deleted my files in the vendor directory!](#dep-deleted-my-files-in-the-vendor-directory)
16
16
*[Can I put the manifest and lock in the vendor directory?](#can-i-put-the-manifest-and-lock-in-the-vendor-directory)
17
17
*[Why did dep use a different revision for package X instead of the revision in the lock file?](#why-did-dep-use-a-different-revision-for-package-x-instead-of-the-revision-in-the-lock-file)
@@ -55,41 +55,41 @@ Here are some suggestions for when you could use `dep` or `go get`:
55
55
> is for people consuming Go code, and dep-family commands are for people developing it.
56
56
-[@sdboyer in #376](https://github.com/golang/dep/issues/376#issuecomment-294045873)
57
57
58
-
## Why did `dep ensure -update` not update package X?
59
-
Is package X a direct dependency? [#385](https://github.com/golang/dep/issues/385)
60
-
61
-
Constraints given in a project's manifest are only applied if the
62
-
dependent project is actually imported. Transitive dependencies (dependencies
63
-
of your imports) are only updated when the revision in the lockfile no
64
-
longer meets the constraints of your direct dependencies.
65
-
66
-
> If you absolutely need to specify the constraint of a transitive dep from your own project, you have two options:
67
-
>
68
-
> Specify the constraint on github.com/gorilla/context via an override. Overrides apply globally, but are a power only given to the root project, so if anything else imports your project, the override won't be used.
69
-
> Mark github.com/gorilla/context as a required package in the manifest. This will cause it to be treated as a direct dependency, and your constraint will come into effect.
70
-
>
71
-
> However, before taking either of those steps, I'd say it's worth asking if you actually need to use master of github.com/gorilla/context. I imagine it's imported by github.com/gorilla/mux - and if that package is OK with using the tagged release instead of master (which is the preferred mode of operation anyway), then maybe that should be good enough for you? If you really needed something out of github.com/gorilla/context, then you'd probably be importing it directly and doing something with it
72
-
-[@sdboyer in #385](https://github.com/golang/dep/issues/385#issuecomment-294361087)
73
-
74
58
## Why is `dep` ignoring the version specified in the manifest?
75
59
Only direct dependencies can be managed with a `dependencies` entry
76
60
in the manifest. Use an `overrides` entry for transitive dependencies.
77
61
78
-
> Constraints:
62
+
> Dependencies:
79
63
>
80
64
> 1. Can be declared by any project's manifest, yours or a dependency
81
65
> 2. Apply only to direct dependencies of the project declaring the constraint
82
-
> 3. Must not conflict with the constraints declared in any other project's manifest
66
+
> 3. Must not conflict with the `dependencies` declared in any other project's manifest
83
67
>
84
68
> Overrides:
85
69
>
86
70
> 1. Are only utilized from the current/your project's manifest
87
71
> 2. Apply globally, to direct and transitive dependencies
88
-
> 3.Supercede constraints declared in all manifests, yours or a dependency's
72
+
> 3.Supersede constraints declared in all manifests, yours or a dependency's
89
73
>
90
74
> Overrides are also discussed with some visuals in [the gps docs](https://github.com/sdboyer/gps/wiki/gps-for-Implementors#overrides).
91
75
-[@sdboyer in #328](https://github.com/golang/dep/issues/328#issuecomment-286631961)
92
76
77
+
78
+
## Why did `dep ensure -update` not update package X?
79
+
This is a symptom of the same problem in [Why is `dep` ignoring the version specified in the manifest?](#why-is-dep-ignoring-the-version-specified-in-the-manifest) and can occur after you had previously added a `dependencies` entry to your manifest for a [transitive dependency](#what-is-a-direct-or-transitive-dependency) and run `dep ensure`. Later when you attempt to update, project X is not updated as expected.
80
+
81
+
If you accidentally use a `dependencies` entry for a transitive dependency, **it is silently ignored**. We have #302 open to detect and print a warning when this occurs.
82
+
83
+
Only direct dependencies can be constrained with a `dependencies` entry, anything else should use a `required` or `overrides` entry.
84
+
85
+
> If you absolutely need to specify the constraint of a transitive dep from your own project, you have two options:
86
+
>
87
+
> 1. Specify the constraint on `github.com/gorilla/context` via an override. Overrides apply globally, but are a power only given to the root project, so if anything else imports your project, the override won't be used.
88
+
> 2. Mark `github.com/gorilla/context` as a required package in the manifest. This will cause it to be treated as a direct dependency, and your constraint will come into effect.
89
+
>
90
+
> However, before taking either of those steps, I'd say it's worth asking if you actually need to use `master` of `github.com/gorilla/context`. I imagine it's imported by `github.com/gorilla/mux` - and if that package is OK with using the tagged release instead of `master` (which is the preferred mode of operation anyway), then maybe that should be good enough for you? If you really needed something out of `github.com/gorilla/context`, then you'd probably be importing it directly and doing something with it
91
+
-[@sdboyer in #385](https://github.com/golang/dep/issues/385#issuecomment-294361087)
92
+
93
93
## `dep` deleted my files in the vendor directory!
94
94
First, sorry! 😞 We hope you were able to recover your files...
0 commit comments