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.
Copy file name to clipboardExpand all lines: FAQ.md
+4-13Lines changed: 4 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,9 @@ Here are some suggestions for when you could use `dep` or `go get`:
83
83
* Use `required` to explicitly add a dependency that is not imported directly or transitively, for example a development package used for code generation.
84
84
* Use `ignored` to ignore a package and any of that package's unique dependencies.
Copy file name to clipboardExpand all lines: docs/Gopkg.toml.md
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -79,8 +79,24 @@ version constraint of a specific dependency.
79
79
Internally, dep uses [Masterminds/semver](https://github.com/Masterminds/semver)
80
80
to work with semver versioning.
81
81
82
-
[Why is dep ignoreing a version constraint in the manifest?](https://github.com/golang/dep/blob/master/FAQ.md#why-is-dep-ignoring-a-version-constraint-in-the-manifest)
82
+
`~` and `=` operators can be used with the versions. When a version is specified
83
+
without any operator, `dep` automatically adds a caret operator, `^`. The caret
84
+
operator pins the left-most non-zero digit in the version. For example:
85
+
```
86
+
^1.2.3 means 1.2.3 <= X < 2.0.0
87
+
^0.2.3 means 0.2.3 <= X < 0.3.0
88
+
^0.0.3 means 0.0.3 <= X < 0.1.0
89
+
```
90
+
91
+
To pin a version of direct dependency in manifest, prefix the version with `=`.
92
+
For example:
93
+
```
94
+
[[constraint]]
95
+
name = "github.com/pkg/errors"
96
+
version = "=0.8.0"
97
+
```
83
98
99
+
[Why is dep ignoring a version constraint in the manifest?](https://github.com/golang/dep/blob/master/FAQ.md#why-is-dep-ignoring-a-version-constraint-in-the-manifest)
0 commit comments