Closed joelpresence closed 6 years ago
Bump. Any updates?
Bump. Any updates? Can somebody please help ... Thanks! :-)
i guess you need to use "godep go build -o main" instead of "go build -o main"
Thanks @fforootd !
But I'm not using godep to build. I'm doing my builds inside of LiteIDE for rapid development and iteration. However, I need godep for deployment to heroku. I just need godep to not break my builds in LiteIDE. Any ideas?
I am closing this issue because the repo is going to be archived.
Expected behavior
Thanks for making this great tool available! :-)
I don't understand how to use godep for local development of my own go app that depends both on external third party go packages as well as my own packages. I've googled and searched the README and I can't find any help on this. Can somebody please help? :-)
I've laid out my workspace according to go standards (multiple of my own go packages in the same git repo):
github.com/mystuff/mycli github.com/mystuff/mycore
OK, I commit all my code to git and then I run
godep save ./...
in themycli
dir which creates directoriesgithub.com/mystuff/mycli/Godeps github.com/mystuff/mycli/vendor
and all is well. I can deploy to Heroku, AWS, etc. Great.
Then I edit some of my files locally in
mycore
, for example adding a new typeFoo
. Then I edit some files inmycli
to use my new typeFoo
. Note that I've made changes locally and these changes are not committed to git yet (because I need to verify that they build and work correctly before committing them).However, now my build is totally broken. Any attempt to build
mycore
with the new typeFoo
succeeds. Any attempt to buildmycli
results in a syntax error./main.go:48: undefined: mycore.Foo
(I updated mycli/main.go to reference the new type Foo). This is not true,mycore.Foo
is perfectly well defined and compiles just fine when Igo build
in themycore
dir.I was stuck unable to build my code, until I did
So it seems that godep was somehow hiding my local changes? I tried to do
godep save ./...
again but godep barfed and said I had a dirty git dir and needed to commit files. But no, I can't do that - I'm not going to commit stuff inmycore
andmycli
just to see if it works properly inmycli
- I need to build and test before committing.So I don't understand, it seems like godep breaks local development? How, during local development, do I tell godep "hey, just use the version of mycli and mycore that are locally on disk, forget about what you think you should use from Godeps.json or vendor for my own code, but still use those fixed versions for other packages".
How do I do that? I'm a go and godep newbie, so apologies if I missed something obvious or some convention - if somebody can help me out I'd be happy to create a PR to update docs to make this more clear.
But I just can't afford to
mv
the godep and vendor dirs each time I need to test local changes to my own code or commit those changes before build. That's just too slow ...Actual behavior
godep should allow local development to use local changes to my own code without interference from Godeps or vendor.
Steps to reproduce behavior
See above.
godep version
outputgodep v79 (darwin/amd64/go1.8)
go version
outputgo version go1.8 darwin/amd64
Contents of Godeps.json file