Create a go.mod file with go mod init, tag a version in your version control system, and push the tag to your remote repository to publish the module.
- Initialize the module with your desired import path.
go mod init example.com/my/module - Tag the current commit with a semantic version number.
git tag -a v1.0.0 -m "Release v1.0.0" - Push the tag to the remote repository to make it available to the proxy.
git push origin v1.0.0