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.
See the help text for more detailed usage instructions.
122
+
On top of that, if you have added new imports to your project or modified the manifest file without running `dep ensure` again, `dep status` will tell you there is a mismatch between the lock file and the current status of the project.
123
+
124
+
```sh
125
+
$ dep status
126
+
Lock inputs-digest mismatch due to the following packages missing from the lock:
This happens when a new import is added. Run `dep ensure` to install the missing packages.
132
+
```
133
+
134
+
As `dep status` suggests, run `dep ensure` to update your lockfile. Then run `dep status` again, and the lock mismatch should go away.
135
+
136
+
### Updating dependencies
137
+
138
+
(to the latest version allowed by the manifest)
139
+
140
+
```sh
141
+
$ dep ensure -update
142
+
```
143
+
144
+
### Removing dependencies
145
+
146
+
1. Remove the `import`s and all usage from your code.
147
+
1. Run
148
+
149
+
```sh
150
+
$ dep ensure
151
+
```
152
+
153
+
1. Remove from `Gopkg.toml`, if it was in there.
154
+
155
+
### Testing changes to a dependency
156
+
157
+
Making changes in your `vendor/` directory directly is not recommended, as dep
158
+
will overwrite any changes. Instead:
159
+
160
+
1. Delete the dependency from the `vendor/` directory.
161
+
162
+
```sh
163
+
rm -rf vendor/<dependency>
164
+
```
165
+
166
+
1. Add that dependency to your `GOPATH`, if it isn't already.
167
+
168
+
```sh
169
+
$ go get <dependency>
170
+
```
171
+
172
+
1. Modify the dependency in `$GOPATH/src/<dependency>`.
173
+
1. Test, build, etc.
174
+
175
+
Don't run `dep ensure`until you're done. `dep ensure` will reinstall the
176
+
dependency into `vendor/` based on your manifest, as if you were installing from
177
+
scratch.
178
+
179
+
This solution works for short-term use, but for something long-term, take a look
180
+
at [virtualgo](https://github.com/GetStream/vg).
181
+
182
+
To test out code that has been pushed as a new version, or to a branch or fork,
183
+
see [changing dependencies](#changing-dependencies).
184
+
185
+
## Semantic Versioning
186
+
187
+
`dep ensure` a uses an external [semver library](https://github.com/Masterminds/semver) to interpret the version constraints you specify in the manifest. The comparison operators are:
188
+
189
+
* `=`: equal
190
+
* `!=`: not equal
191
+
* `>`: greater than
192
+
* `<`: less than
193
+
* `>=`: greater than or equal to
194
+
* `<=`: less than or equal to
195
+
* `-`: literal range. Eg: 1.2 - 1.4.5 is equivalent to >= 1.2, <= 1.4.5
196
+
* `~`: minor range. Eg: ~1.2.3 is equivalent to >= 1.2.3, < 1.3.0
197
+
* `^`: major range. Eg: ^1.2.3 is equivalent to >= 1.2.3, < 2.0.0
198
+
* `[xX*]`: wildcard. Eg: 1.2.x is equivalent to >= 1.2.0, < 1.3.0
199
+
200
+
You might, for example, include a constraint in your manifest that specifies `version = "=2.0.0"` to pin a dependency to version 2.0.0, or constrain to minor releases with: `version = "2.*"`. Refer to the [semver library](https://github.com/Masterminds/semver) documentation for more info.
201
+
202
+
**Note**: When you specify a version *without an operator*, `dep` automatically uses the `^` operator by default. `dep ensure` will interpret the given version as the min-boundry of a range, for example:
203
+
204
+
* `1.2.3` becomes the range `>=1.2.3, <2.0.0`
205
+
* `0.2.3` becomes the range `>=0.2.3, <0.3.0`
206
+
* `0.0.3` becomes the range `>=0.0.3, <0.1.0`
53
207
54
208
## Feedback
55
209
56
210
Feedback is greatly appreciated.
57
211
At this stage, the maintainers are most interested in feedback centered on the user experience (UX) of the tool.
58
212
Do you have workflows that the tool supports well, or doesn't support at all?
59
213
Do any of the commands have surprising effects, output, or results?
60
-
Please check the existing issues and [FAQ](FAQ.md) to see if your feedback has already been reported.
214
+
Please check the existing issues and [FAQ](docs/FAQ.md) to see if your feedback has already been reported.
61
215
If not, please file an issue, describing what you did or wanted to do, what you expected to happen, and what actually happened.
62
216
63
217
## Contributing
@@ -67,4 +221,3 @@ The maintainers actively manage the issues list, and try to highlight issues sui
67
221
The project follows the typical GitHub pull request model.
68
222
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
69
223
Before starting any work, please either comment on an existing issue, or file a new one.
0 commit comments