-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update imports to reference vendored packages #3
Conversation
Signed-off-by: Lewis Marshall <lewis@lmars.net>
This is the result of running `godep save -r ./...` Signed-off-by: Lewis Marshall <lewis@lmars.net>
I'm not sure I'm following. I looked at the documentation again and I thought it is okay as long as you run any On the other hand, it's true that you may have a missing package using the godep prefix because it would search your GOPATH... I still haven't figured out how we can automatically detect a missing dependency in the Godep folder... All in all, I would prefer to not reference the godep folder at all. WDYT? |
Using the Vendoring downloads all the dependent packages into So it looks like the intention in this repository was to use the vendored strategy, so this PR fixes that. If we want to use the |
AFAIK
The only thing that
So IMO, as long as we run go commands with the Note that as I said in a previous comment, the only downside is that it will look up in |
@@ -11,7 +11,7 @@ import ( | |||
|
|||
"go/build" | |||
|
|||
"github.com/onsi/ginkgo/ginkgo/nodot" | |||
"github.com/ably/ably-go/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/nodot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you are supposed to do this. The godep
prefix will make it so that the Godep folder is the first being looked into.
Also it would be quite a pain when running godep update my_package/path
to have to update this line again. And we would have to make sure that any new import is actually going to the Godeps
folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be quite a pain when running godep update my_package/path to have to update this line again. And we would have to make sure that any new import is actually going to the Godeps folder.
godep
knows how to rewrite the paths and add code to the Godeps
directory (I used godep
to make this change).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which command? 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
godep save -r ./...
Oh yes I am wrong,
But why require the use of |
I would be okay with that if this would only affect our code but you are modifying vendor files which is a no-no in my book 😉. See my comment here: #3 (comment). Also at this point I would say that it's the same as |
@kouno I will leave it up to you whether to accept or reject this, I can see your concerns and I have no issue using the |
Just saw your last comment... If godep supports that by default that's better and a bit different, even if I personally don't really like this philosophy. I'll sleep on it and decide tomorrow 😄. |
Ok so apparently the gods must have heard my painful cry over the internet because a new (or another?) discussion popped up in the golang google group (https://groups.google.com/forum/#!topic/golang-dev/nMWoEAG55v8). Google is, as you stated, using this vendoring method (without I'm going to leave this PR open as a reminder that it's an issue that needs to be fixed, and maybe when we get to go 1.5 we will have a consensus on the method the go team / community agreed on. In the meantime, use the |
@kouno it's interesting to read the discussion on Go 1.5 and it sounds like this is clearly an issue that does need to be standardised. Personally however, I think removing the need to run BTW. I agree the import path rewrite feels wrong, however what it does offer is robustness and ease of use for people using this library, which is arguably paramount for us. |
@mattheworiordan I think you have a point there. I'm merging @lmars changes for the sake of keeping the project stable for everyone. As a side note I added a pre-commit hook on my machine to avoid importing non-vendored packages. #!/bin/bash
set -e
unset GIT_DIR
cd "$(godep path)/../.."
godep save -r ./...
godep_imports="$(git diff | grep 'Godeps/_workspace' | wc -l)"
if [ "$godep_imports" -gt 0 ]; then
cat <<\EOF
ERROR: Some Go dependencies have been updated with `godep save -r ./...`
ERROR: Please add them to your commit.
EOF
exit 1
fi
exit 0 I'll keep an eye on the go 1.5 discussion, and hopefully we can get this sorted in the (near?) future. |
Update imports to reference vendored packages
The dependencies have already been vendored using godep (see 5d8ca38) but they were not being referenced.
This is the result of running
godep save -r ./...
.