@@ -41,10 +41,9 @@ To start managing dependencies using dep, run the following from your project ro
41
41
42
42
``` sh
43
43
$ dep init
44
- $ dep ensure -update
45
44
```
46
45
47
- ` dep init ` will do the following:
46
+ This does the following:
48
47
49
48
1 . Look for [ existing dependency management files] ( docs/FAQ.md#what-external-tools-are-supported ) to convert
50
49
1 . Check if your dependencies use dep
@@ -57,10 +56,13 @@ $ dep ensure -update
57
56
58
57
## Usage
59
58
60
- There is one main subcommand you will use: ` dep ensure ` . ` ensure ` synchronizes
61
- your dependencies in ` vendor/ ` to make sure they match what's in your ` import ` s
62
- and ` Gopkg.toml ` . ` dep ensure ` is safe to run early and often. See the help text
63
- for more detailed usage instructions.
59
+ There is one main subcommand you will use: ` dep ensure ` . ` ensure ` first makes
60
+ sure ` Gopkg.lock ` is consistent with your ` import ` s and ` Gopkg.toml ` . If any
61
+ changes are detected, it then populates ` vendor/ ` with exactly what's described
62
+ in ` Gopkg.lock ` .
63
+
64
+ ` dep ensure ` is safe to run early and often. See the help text for more detailed
65
+ usage instructions.
64
66
65
67
``` sh
66
68
$ dep help ensure
@@ -70,6 +72,8 @@ $ dep help ensure
70
72
71
73
(if your ` vendor/ ` directory isn't [ checked in with your code] ( ](docs/FAQ.md#should-i-commit-my-vendor-directory) ) )
72
74
75
+ <!-- may change with https://github.com/golang/dep/pull/489 -->
76
+
73
77
``` sh
74
78
$ dep ensure
75
79
```
@@ -80,8 +84,8 @@ matches the constraints from the manifest. If the dependency is missing from
80
84
81
85
### Adding a dependency
82
86
83
- 1 . Add the ` import ` in your source code file(s).
84
- 1 . Download via dep .
87
+ 1 . ` import ` the package in your ` *.go ` source code file(s).
88
+ 1 . Run the following command to update your ` Gopkg.lock ` and populate ` vendor/ ` with the new dependency .
85
89
86
90
``` sh
87
91
$ dep ensure
@@ -156,7 +160,11 @@ Don't run `dep ensure` until you're done. `dep ensure` will reinstall the
156
160
dependency into `vendor/` based on your manifest, as if you were installing from
157
161
scratch.
158
162
159
- To test out code that is pushed, see [changing dependencies](#changing-dependencies).
163
+ This solution works for short-term use, but for something long-term, take a look
164
+ at [virtualgo](https://github.com/GetStream/vg).
165
+
166
+ To test out code that has been pushed as a new version, or to a branch or fork,
167
+ see [changing dependencies](#changing-dependencies).
160
168
161
169
## Feedback
162
170
0 commit comments