Y
Hacker News
new
|
ask
|
show
|
jobs
by
preseinger
1526 days ago
> There's a couple of repos at work which contain multiple Go modules (each in their own subdirectory, with their own go.mod files).
There's almost no reason to do this. 1 repo = 1 module. Even for monorepos.
1 comments
gkfasdfasdf
1526 days ago
Can you elaborate? What if you have multiple commands (main.go) with differing dependencies?
link
preseinger
1520 days ago
They can (and usually should) exist in a single module. Each compiled artifact will link in only the dependencies it requires, not all of the dependencies of the parent module.
link