Publishing as a Go module
Publish your public-facing Fern Go SDK to pkg.go.dev.

This page assumes that you have:
- An initialized
fernfolder. See Set up thefernfolder. - A GitHub repository for your SDK. See Project Structure.
Requirements
Go SDKs are automatically published to pkg.go.dev when you push a semantic version tag to your repository and the repository meets the below requirements. No dedicated CI is needed.
Your repository must have:
- Public visibility
- An approved license such as MIT or Apache 2.0
- A valid module path in
go.mod, which determines your publish URL. For example,github.com/your-org/your-sdkpublishes tohttps://pkg.go.dev/github.com/your-org/your-sdk. If your module path includes a major version suffix like/v2, your SDK publishes to that versioned URL instead (https://pkg.go.dev/github.com/your-org/your-sdk/v2).
Configure generators.yml
Publish to pkg.go.dev
At this point, you’re ready to generate a release for your SDK.
Generate your release
Regenerate your SDK and publish it on pkg.go.dev:
Local machine output will verify that the release is pushed to your repository and tagged with the version you specified.
Verify on pkg.go.dev
Once the semantic version tag is pushed, pkg.go.dev will automatically index your package. Navigate to https://pkg.go.dev/<go-module-path-in-go.mod> to verify your SDK is published.
After releasing a new version, it may take a few minutes for pkg.go.dev
to index and display the update. You can also check if the Go
proxy has indexed your module at
https://proxy.golang.org/<go-module-path-in-go.mod>/@v/list. pkg.go.dev
indexing usually happens within 5-15 minutes of the proxy picking it up.
For more information, see Go’s documentation on Adding a package.