For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Overview
    • Introduction
    • How it works
    • Quickstart
    • Customer showcase
  • Working with SDKs
    • Project structure
    • Adding custom code
    • Migrating to Replay
    • Capabilities
  • Generators
      • Generating an SDK
      • Publishing as a Go module
      • Configuration
      • Adding custom code
      • Changelog
      • Customer showcase
  • Reference
    • generators.yml
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • Requirements
  • Configure generators.yml
  • Publish to pkg.go.dev
GeneratorsGo

Publishing as a Go module

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Generating an SDK

Next

Go configuration

Publish your public-facing Fern Go SDK to pkg.go.dev.

This page assumes that you have:

  • An initialized fern folder, a GitHub repository for your Go SDK, and a Go generator group in generators.yml. See Generating an SDK (Go).
Versioned package published on Pkgsite

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-sdk publishes to https://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

1

Configure output location

Go publishes via Git repositories, so remove the auto-generated output and config properties. Instead, add the path to your GitHub repository:

1groups:
2 go-sdk:
3 generators:
4 - name: fernapi/fern-go-sdk
5 version: 1.40.0
6 github:
7 repository: devalog/company-go

Publish to pkg.go.dev

At this point, you’re ready to generate a release for your SDK.

1

Generate your release

Regenerate your SDK and publish it on pkg.go.dev:

$fern generate --group go-sdk --version <version>

Local machine output will verify that the release is pushed to your repository and tagged with the version you specified.

2

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.