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: docs/FAQ.md
+48-1Lines changed: 48 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ The FAQ predated the introduction of the rest of the documentation. If something
12
12
## Configuration
13
13
*[What is the difference between Gopkg.toml (the "manifest") and Gopkg.lock (the "lock")?](#what-is-the-difference-between-gopkgtoml-the-manifest-and-gopkglock-the-lock)
14
14
*[How do I constrain a transitive dependency's version?](#how-do-i-constrain-a-transitive-dependency-s-version)
15
+
*[How do I change the version of a dependecy?](#how-do-i-change-the-version-of-a-dependecy)
15
16
*[Can I put the manifest and lock in the vendor directory?](#can-i-put-the-manifest-and-lock-in-the-vendor-directory)
16
17
*[How do I get `dep` to authenticate to a `git` repo?](#how-do-i-get-dep-to-authenticate-to-a-git-repo)
17
18
*[How do I get `dep` to consume private `git` repos using a Github Token?](#how-do-i-get-dep-to-consume-private-git-repos-using-a-github-token)
@@ -29,11 +30,12 @@ The FAQ predated the introduction of the rest of the documentation. If something
29
30
30
31
## Best Practices
31
32
*[Should I commit my vendor directory?](#should-i-commit-my-vendor-directory)
33
+
*[How do I test changes to a dependency?](#how-do-i-test-changes-to-a-dependency)
32
34
*[How do I roll releases that `dep` will be able to use?](#how-do-i-roll-releases-that-dep-will-be-able-to-use)
33
35
*[What semver version should I use?](#what-semver-version-should-i-use)
34
36
*[Is it OK to make backwards-incompatible changes now?](#is-it-ok-to-make-backwards-incompatible-changes-now)
35
37
*[My dependers don't use `dep` yet. What should I do?](#my-dependers-don-t-use-dep-yet-what-should-i-do)
36
-
*[How do I configure a dependency that doesn't tag its releases?](#how-do-i-configure-a-dependency-that-doesn-t-tag-its-releases)
38
+
*[How do I configure a dependency that doesn't tag its release](#how-do-i-configure-a-dependency-that-doesn-t-tag-its-releases)
37
39
*[How do I use `dep` with Docker?](#how-do-i-use-dep-with-docker)
38
40
*[How do I use `dep` in CI?](#how-do-i-use-dep-in-ci)
39
41
@@ -107,6 +109,21 @@ behave differently:
107
109
108
110
Overrides are also discussed with some visuals in [the gps docs](https://github.com/sdboyer/gps/wiki/gps-for-Implementors#overrides).
109
111
112
+
## How do I change the version of a dependecy
113
+
114
+
If you want to:
115
+
116
+
* Change the allowed `version`/`branch`/`revision`
117
+
* Switch to using a fork
118
+
119
+
for one or more dependencies, do the following:
120
+
121
+
1. Manually edit your `Gopkg.toml`.
122
+
1. Run
123
+
124
+
```sh
125
+
$ dep ensure
126
+
```
110
127
## Can I put the manifest and lock in the vendor directory?
111
128
No.
112
129
@@ -350,6 +367,36 @@ It's up to you:
350
367
- PR diffs will include changes for files under `vendor/` when Gopkg.lock is modified,
351
368
however files in `vendor/` are [hidden by default](https://github.com/github/linguist/blob/v5.2.0/lib/linguist/generated.rb#L328) on Github.
352
369
370
+
## How do I test changes to a dependency?
371
+
372
+
Making changes in your `vendor/` directory directly is not recommended, as dep
373
+
will overwrite any changes. Instead:
374
+
375
+
1. Delete the dependency from the `vendor/` directory.
376
+
377
+
```sh
378
+
rm -rf vendor/<dependency>
379
+
```
380
+
381
+
1. Add that dependency to your `GOPATH`, if it isn't already.
382
+
383
+
```sh
384
+
$ go get <dependency>
385
+
```
386
+
387
+
1. Modify the dependency in`$GOPATH/src/<dependency>`.
388
+
1. Test, build, etc.
389
+
390
+
Don't run `dep ensure` until you're done. `dep ensure` will reinstall the
391
+
dependency into `vendor/` based on your manifest, as if you were installing from
392
+
scratch.
393
+
394
+
This solution works for short-term use, but for something long-term, take a look
395
+
at [virtualgo](https://github.com/GetStream/vg).
396
+
397
+
To test out code that has been pushed as a new version, or to a branch or fork,
398
+
see [changing dependencies](#how-do-i-change-change-the-version-of-a-dependecy).
399
+
353
400
## How do I roll releases that `dep` will be able to use?
354
401
355
402
In short: make sure you've committed your `Gopkg.toml` and `Gopkg.lock`, then
0 commit comments