# Publishing as a Go module

> Learn how to publish your Fern-generated Go SDK to pkg.go.dev. Configure generators.yml and release versioned Go modules.

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.

<Frame>
  <img src="https://files.buildwithfern.com/fern.docs.buildwithfern.com/learn/7a3d5518064057b524561b3a039edcfbd77d41a31ec12ffbcd53a962255a20d3/products/sdks/overview/go/assets/go-package.png" alt="Versioned package published on Pkgsite" />
</Frame>

<Info>
  This page assumes that you have:

  * An initialized `fern` folder. See [Set up the `fern`
    folder](/sdks/overview/quickstart).
  * A GitHub repository for your SDK. See [Project Structure](/sdks/overview/project-structure).
</Info>

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

## Configure `generators.yml`

<Steps>
  <Step title="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:

    ```yaml {6-7}
    groups: 
      go-sdk:
        generators:
          - name: fernapi/fern-go-sdk
            version: 1.23.4
            github:
              repository: devalog/company-go

    ```
  </Step>
</Steps>

## Publish to pkg.go.dev

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

<Steps>
  <Step title="Generate your release">
    Regenerate your SDK and publish it on pkg.go.dev:

    ```bash
    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.
  </Step>

  <Step title="Publish 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/)!

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

      For more information, see Go's documentation on [Adding a
      package](https://pkg.go.dev/about#adding-a-package).
    </Tip>
  </Step>
</Steps>