Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit c0f3d80

Browse files
committed
Expand the first-run documentation
- Clarified that the Usage commands in the README apply to both new and existing projects - Move information about the vendor directory backup into the README. This gives the user the necessary context as soon as they would need it, rather than needing to stumble upon it (somewhat buried) in the FAQ.
1 parent 02c31e3 commit c0f3d80

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ Get the tool via
3636
$ go get -u github.com/golang/dep/cmd/dep
3737
```
3838

39-
Typical usage on a new repo might be
39+
Typical usage - either on a new project or converting an existing one - is
4040

4141
```sh
4242
$ dep init
4343
$ dep ensure -update
4444
```
4545

46+
If your project was already using a `vendor/` directory, it was backed up to `_vendor-TIMESTAMP/`.
47+
4648
To update a dependency to a new version, you might run
4749

4850
```sh
@@ -51,6 +53,10 @@ $ dep ensure github.com/pkg/errors@^0.8.0
5153

5254
See the help text for more detailed usage instructions.
5355

56+
```sh
57+
$ dep help ensure
58+
```
59+
5460
## Feedback
5561

5662
Feedback is greatly appreciated.

docs/FAQ.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Summarize the question and quote the reply, linking back to the original comment
2424
* [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)
2525
* [Why is `dep` slow?](#why-is-dep-slow)
2626
* [How does `dep` handle symbolic links?](#how-does-dep-handle-symbolic-links)
27-
* [`dep` deleted my files in the vendor directory!](#dep-deleted-my-files-in-the-vendor-directory)
2827

2928
## Best Practices
3029
* [Should I commit my vendor directory?](#should-i-commit-my-vendor-directory)
@@ -249,13 +248,6 @@ When `dep` is invoked with a project root that is a symlink, it will be resolved
249248

250249
This is the only symbolic link support that `dep` really intends to provide. In keeping with the general practices of the `go` tool, `dep` tends to either ignore symlinks (when walking) or copy the symlink itself, depending on the filesystem operation being performed.
251250

252-
## `dep` deleted my files in the vendor directory!
253-
If you just ran `dep init`, there should be a copy of your original vendor directory named `_vendor-TIMESTAMP` in your project root. The other commands do not make a backup before modifying the vendor directory.
254-
255-
> dep assumes complete control of vendor/, and may indeed blow things away if it feels like it.
256-
-[@peterbourgon in #206](https://github.com/golang/dep/issues/206#issuecomment-277139419)
257-
258-
259251
## Best Practices
260252
### Should I commit my vendor directory?
261253

@@ -276,7 +268,7 @@ It's up to you:
276268
> I would recommend against ever working in your vendor directory since dep will overwrite any changes. It’s too easy to lose work that way.
277269
-[@carolynvs in #706](https://github.com/golang/dep/issues/706#issuecomment-305807261)
278270

279-
If you have a fork, add a `[[constraint]]` entry for the project in `Gopkg.toml` and set `source` to the fork source. This will ensure that `dep` will fetch the project from the fork instead of the original source.
271+
If you have a fork, add a `[[constraint]]` entry for the project in `Gopkg.toml` and set `source` to the fork source. This will ensure that `dep` will fetch the project from the fork instead of the original source.
280272
Otherwise, if you want to test changes locally, you can delete the package from `vendor/` and make changes directly in `GOPATH/src/*package*` so that your changes are picked up by the go tool chain.
281273

282274
## How do I roll releases that `dep` will be able to use?

0 commit comments

Comments
 (0)