On Sat, Nov 10, 2018, at 09:46, Paul Jolly wrote: > > 2. "Why doesn't "go build" run "go mod tidy" automatically? > > It does in as much as adding missing dependencies are concerned, but > doesn't do the tidying (removal) in go.{mod,sum} that go mod tidy > does.
I don't think this is true (unless this has been fixed, I can't upgrade to check right this moment), go build respects build constraints (eg. you won't get dependencies that only exist in tests), so even if you're just talking about adding missing dependencies, build won't necessarily help you. I've noticed this causing a lot of confusion in libraries moving to modules where dependencies get left out because they're hidden behind a build tag, or only get added when tests are run. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.