217 points · by omginternets · 10y ago · 64 comments
> Go 1.6 includes support for using local copies of external dependencies to satisfy imports of those dependencies, often referred to as vendoring.
I would expect the best patterns to come from the community which is something Rob Pike pointed to at the first Gophercon.
I've been trying to learn Go as a sideproject for less than a month, and even I realize what the problem is and how the vendor spec solves it (at least once getting to the end where it says that with vendoring enabled submodules are automatically retrieved with go get.. I don't know why they didn't get to that earlier.)
One of the things I miss the most when working in Go is PHP Composer, and it's pretty obvious how the vendor design doc solves the same problem in a more Go idiomatic way.
Glide[1] is a tool like Composer but for Go and it uses the vendor/ directory. It's designed to complement the go commands.
disclosure: I'm one of the glide devs
> NOTE: This is a DRAFT of the Go 1.6 release notes, prepared for the Go 1.6 beta. Go 1.6 has NOT yet been released. By our regular schedule, it is expected some time in February 2016.
If they just printed out each file as it was compiled, it would go back to feeling lightning fast. :)
(Maybe there's a way to do this?)
Builds in Go 1.5 will be slower by a factor of about two. The automatic translation of the compiler and linker from C to Go resulted in unidiomatic Go code that performs poorly compared to well-written Go. Analysis tools and refactoring helped to improve the code, but much remains to be done. Further profiling and optimization will continue in Go 1.6 and future releases. For more details, see these slides and associated video.
Thanks!
It's not clear to me what work is left, but hopefully it gets merged super early in the 1.7 cycle.
But what's happening with the work on shared libraries? :(
I'm also interested in the vendoring support. I've been using godep and I haven't really taken a look at the vendoring in 1.5 yet (being experimental and all).
I could use a tool that I could fire at a codebase that asserts that all imports are either coming out of the vendor directory or coming out of the base system.
Or are there still problems that aren't mentioned in that issue?
It's an extremely useful feature in Python, and makes for more elegant APIs.
But in general, if you have a two-argument function and one of the arguments could be defaulted, just pass it. It's clearer at the call point what's happening then.
The linked article is part of the "static" documentation set though, which has no feed.
It's not ideal but Github does provide a "releases" feed, though it only links to the tagged commit (it's essentially a feed dump of https://github.com/golang/go/releases) you at least get a notification of new releases: https://github.com/golang/go/releases.atom
/kidding :p