Overview
Go registry features:- Standard Go module proxy protocol
- Automatic
.mod,.info, and.zipfile generation - Version management following Go module versioning
- Private module authentication
Pushing Go modules
Use thehc artifact push go command to publish Go modules:
Required flags
Version for the Go module (must follow semantic versioning, e.g., v1.0.0)
Optional flags
Base URL for the package service. If not provided, derives from
--api-urlHow it works
The CLI automatically:- Validates the folder contains valid Go source code
- Generates the
.modfile fromgo.mod - Creates the
.infofile with version metadata - Packages source code into a
.zipfile - Uploads all three files as a multipart form request
Consuming Go modules
After configuring your Go environment, import modules as usual:Authentication
Configure Git credentials for private module access:Examples
Version requirements
Go module versions must follow semantic versioning with a
v prefix (e.g., v1.0.0, v2.1.3-beta.1)v1.0.0- Standard releasev2.1.0-alpha.1- Pre-releasev1.0.0+build.123- Build metadata
Troubleshooting
Version is required error
Version is required error
The
--version flag is mandatory for Go module uploads.Invalid Go module structure
Invalid Go module structure
Ensure your folder contains a valid
go.mod file at the root:Authentication failures
Authentication failures
Verify your credentials are configured correctly: