Hacker News new | ask | show | jobs
by jniedrauer 2287 days ago
Go modules are built around git, unlike many other languages package systems. That means you don't get to pick and choose what goes into them. Imagine if you had to put an empty package.json in every (non-node) directory of your git repo to exclude it from an NPM package, or an install.py in every (non-python) directory to exclude it from a PyPI package. Multi-language repos would get ridiculous pretty quickly.
2 comments

> Go modules are built around git

Not really. Modules are specced based on zip files and metadata in text files. There's just support for extracting that data from git repos transparently.

Here's a slightly out of date write-up: https://research.swtch.com/vgo-module

This is only an issue if you put a go.mod file at the top level of your repo. We have monorepos with hundreds of modules.