by burntsushi · 12y ago · 0 comments
Then don't do it. Check your dependencies into your repositories and update import paths.
This is the problem that Maven, RubyGems, etc. have fixed for so very long that I find it really hard to take Go seriously when this is floated as a solution. And that seems to be a regular occurrence in Go: the willing championing of bad but "simple" solutions (error codes as far as the eye can see!) under the mistaken assumption that things are complex just to be complex rather than that they're complex because they solve a bigger problem.
I can imagine a script that's just a few lines that downloads go-gettable dependencies and updates import paths. You run it at exactly the time you want to update.
> have fixed for so very long that I find it really hard to take Go seriously when this is floated as a solution
By a large margin, I spend the least amount of time configuring my Go packages for release than for any other language.
"Write a script" is a poor solution for an endemic problem.
And I can imagine an CSP implementation for C. Should we ditch Go then?
A shell script that runs a few `sed` commands isn't.
Need a mature build tool? Then use one and stop complaining.
http://support.thoughtworks.com/entries/20074167-Using-Maven...
Copy the new version into the repository, run the import rewriting script and check it in.
> Why is it better to spread the responsibility for updates over all Go authors instead of to the authors of the libraries in question?
Because you want to have full control over your dependencies. What if the author introduces a breaking change or removes the repository from the internet? Do you want to risk your business by being at the mercy of someone else's repository?
A single tool, "go get", pulls code directly from 3rd parties and puts it in $GOPATH. If you're uncomfortable or frustrated using "go get" there are a number of 3rd party options.