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
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Summarize the question and quote the reply, linking back to the original comment
18
18
*[Can I put the manifest and lock in the vendor directory?](#can-i-put-the-manifest-and-lock-in-the-vendor-directory)
19
19
*[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)
20
20
*[Why is `dep` slow?](#why-is-dep-slow)
21
+
*[How does `dep` handle symbolic links?](#how-does-dep-handle-symbolic-links)
21
22
22
23
## What is the difference between Gopkg.toml (the "manifest") and Gopkg.lock (the "lock")?
23
24
@@ -178,4 +179,16 @@ gateway to all of these improvements.
178
179
179
180
There's another major performance issue that's much harder - the process of picking versions itself is an NP-complete problem in `dep`'s current design. This is a much trickier problem 😜
180
181
182
+
## How does `dep` handle symbolic links?
183
+
184
+
> because we're not crazy people who delight in inviting chaos into our lives, we need to work within one GOPATH at a time.
185
+
-[@sdboyer in #247](https://github.com/golang/dep/pull/247#issuecomment-284181879)
186
+
187
+
Out of convenience, one might create a symlink to a directory within their `GOPATH`, e.g. `ln -s ~/go/src/github.com/golang/dep dep`. When `dep` is invoked it will resolve the current working directory accordingly:
188
+
189
+
- If the cwd is a symlink outside a `GOPATH` and links to directory within a `GOPATH`, or vice versa, `dep` chooses whichever path is within the `GOPATH`. If neither path is within a `GOPATH`, `dep` produces an error.
190
+
- If both the cwd and resolved path are in the same `GOPATH`, an error is thrown since the users intentions and expectations can't be accurately deduced.
191
+
- If the symlink is within a `GOPATH` and the real path is within a *different*`GOPATH` - an error is thrown.
192
+
193
+
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.
0 commit comments