Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions fern/products/sdks/overview/go/publishing-to-go-package-manager.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ description: Learn how to publish your Fern-generated Go SDK to pkg.go.dev. Conf
---

Publish your public-facing Fern Go SDK to
[pkg.go.dev](https://proxy.golang.org/). After following the steps on this page,
you'll have a versioned package published on pkg.go.dev.
[pkg.go.dev](https://pkg.go.dev/).

<Frame>
<img src="assets/go-package.png" alt="Versioned package published on Pkgsite" />
</Frame>

<Markdown src="/products/sdks/snippets/setup-fern-folder-callout.mdx"/>

<Note>
To successfully publish your SDK as a Go module, your repository must have:
* **Public** visibility
* An [approved license](https://pkg.go.dev/license-policy) (e.g. [MIT](https://opensource.org/license/mit), [Apache](https://www.apache.org/licenses/LICENSE-2.0))
</Note>
## Requirements


Go SDKs are automatically published to [pkg.go.dev](https://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](https://pkg.go.dev/license-policy) such as [MIT](https://opensource.org/license/mit) or [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Acronyms] 'MIT' has no definition.

- 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`

Expand Down Expand Up @@ -64,16 +65,16 @@ you'll have a versioned package published on pkg.go.dev.

</Step>

<Step title="Publish on pkg.go.dev">
<Step title="Verify on pkg.go.dev">

Navigate to `https://pkg.go.dev/github.com/<github-org>/<github-repo-name>/` and send a request to index your package. In a few minutes, your new release should be published to [https://pkg.go.dev/](https://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.

<Tip>
After releasing a new version, it may take a few minutes for pkg.go.dev
to index and display the update. You can also try checking to see if the Go
to index and display the update. You can also check if the Go
proxy has indexed your module at
`https://proxy.golang.org/github.com/<github-org>/<github-repo-name>/@v/list`. pkg.go.dev
indexing usually happens within 5-15 min of the proxy picking it up.
`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](https://pkg.go.dev/about#adding-a-package).
Expand Down