by spacey on 3/20/19, 3:44 PM with 118 comments
by ilovecaching on 3/20/19, 4:51 PM
I do think it's kind of odd that it decides to put packages in GOPATH, but disallows you from coexisting go mod projects in GOPATH. I organize all my code for all my languages using the go repo as dir. I've had to maintain a separate tree for go mod which is not ideal.
After using Go dep and mod, I felt that dep was the super straightforward and obvious way to do it. It's how I would have done it. Go mod is much more Goish, it's opinionated and based on a philosophy that fits with the language. It Gives me hope that if they do add generics they will make them uniquely Go as well.
by joshklein on 3/20/19, 4:55 PM
I used to be annoyed that I had to put every go project into a dir 7-8 layers below that e.g ~/work/go/src/github.com/joshklein/project/cmd/hello_world.go, but now I can have ~/work/go_hello/src/main.go. Right?
I understand this isn’t the main point, but frankly it’s the thing I care the most about.
by mikepurvis on 3/20/19, 5:29 PM
For a commercial entity shipping software which may include upstream components, it's important to have options for maintaining (and versioning) in-house forks of upstream components. This becomes a problem when you fork v1.2.3 from upstream and want to internally release your fixes, but now your internal 1.2.4 and upstream's 1.2.4 both have the same number but diverge in content.
I like the Debian solution to this, which permits freeform textual suffixes, so that in the hypothetical scenario above, you can release v1.2.3bigco1, v1.2.3bigco2, with the final number indicating the version of the patchset being applied onto the upstream release; then it's also clear what to do when you rebase your fork because you've maintained the integrity of the upstream version.
by Animats on 3/20/19, 5:50 PM
Looks up where? GOPATH? The tree below the current file? The current directory? What's the "current module", anyway? Where is that stored?
"go: downloading rsc.io/sampler v1.3.0"
Downloading from where? Github? From what repository? The page for "go get" now talks about "module-aware" mode, but doesn't make it clear how that works.
This is the usual headache with dependency systems. There's some specific directory layout required, and you have to know what it is. This article needs to be more explicit about that. Otherwise you end up depending on lore and monkey copying.
by dimgl on 3/20/19, 4:53 PM
replace pkg => ../../pkg
And I can refer to everything inside of `pkg` (`pkg` is its own module as well).by sethammons on 3/20/19, 4:51 PM
> go mod init creates a new module, initializing the go.mod file that describes it.
> go build, go test, and other package-building commands add new dependencies to go.mod as needed.
> go list -m all prints the current module’s dependencies.
> go get changes the required version of a dependency (or adds a new dependency).
> go mod tidy removes unused dependencies.
And you can use some sugar to declare exact versions you want.
by fourseventy on 3/20/19, 4:59 PM
by antwerpen on 3/20/19, 5:12 PM
I was coincidentally converting my Go project to use Go modules yesterday. I depended on a Google API which was originally retrieved via 'Go get', corresponded to docs and worked fine as this pulled from HEAD. `go mod` did not work out of the box, as it required the latest semantic version (v.0.2.0) of my this Google API import. This version, however, is behind documentation and broke my code.
I understand I can require a specific commit in the go.mod file, but the strings for specific commit seem cryptic. Where can I look up the version hash that matches the doc site?
by minieggs on 3/20/19, 8:57 PM
by presscast on 3/20/19, 7:38 PM
I haven't felt the need for them.
At what point do they become necessary? Which pain-points should I be on the lookout for?
by nicpottier on 3/20/19, 9:44 PM
Realize this is a tooling issue and not necessarily a language one, but do feel like they should be mentioning this. It makes working with modules pretty painful. (we are doing it but man do I miss simple refactors / usages etc..)
by fiatjaf on 3/20/19, 5:59 PM
This thing apparently doesn't solve my problem. `go mod tidy` simply removes a dependency from a module, but that dependency is still cached in a big arcane directory at $GOPATH/src/mod. Why?
I think we all should be using something like Nix for dependency management that solves all problems, but that is so hard to setup!
by aw4y on 3/20/19, 5:02 PM
by skybrian on 3/20/19, 5:22 PM
- There's a duplicated section starting with: "Note that our module now depends on both rsc.io/quote and rsc.io/quote/v3:"
- In the example of upgrading a major version, Hello was renamed to HelloV3, but the caller isn't renamed. It should be "quoteV3.HelloV3".
by gfs on 3/20/19, 5:45 PM
by tschellenbach on 3/20/19, 6:25 PM
other than that it works like a charm, here's a tutorial i wrote: https://getstream.io/blog/go-1-11-rocket-tutorial/
by mmgutz on 3/20/19, 10:44 PM
by mirceal on 3/20/19, 5:41 PM
I am baffled to why Go has not figured this out and are presenting recent developments as some kind of breakthroughs - they are not.
To me, and I'm not trying to be disrespectful here, because of the shortcomings it has, Go is in the experimental/keep an eye on bucket. It does some things really, really well but it's far from the panacea most developers that use it think it is.