Go packages by Fox.ONE
Before this change, we put a single go.mod
file in the root directory, any project that import the library will have a lot of unnecessary dependencies.
Then we delete the global go.mod
file and put go.mod
in each sub-package directory, based on this, there are some points that need attention here,
- Migrate from old way, remove the
github.com/fox-one/pkg
line in yourgo.mod
file, then executego mod tidy
will load all sub-package you imported. - No more tags like
vX.Y.Z
will be created later, according to the go mod doc, usesub-package/vX.Y.Z
instead. - When you add a new sub-package, make sure that your sub-package does not depend on
github.com/fox-one/pkg
, otherwise it will lead to dependency conflict for the user.