--- title: Go | Stainless description: Generate production-ready Go SDKs from your OpenAPI specification --- Go is fully supported. The Stainless Go SDK generator creates idiomatic, type-safe Go client libraries from your OpenAPI specification. **Example repositories:** - [cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go) - [orbcorp/orb-go](https://github.com/orbcorp/orb-go) - [knocklabs/knock-go](https://github.com/knocklabs/knock-go) ## Configuration To generate a Go SDK, add the `go` target to your Stainless configuration file: ``` targets: go: module_path: github.com/my-org/my-sdk-go edition: go.2025-10-08 ``` ### Common configuration options ``` targets: go: module_path: github.com/my-org/my-sdk-go # Specify the edition edition: go.2025-10-08 ``` For a complete list of configuration options, see the [Go target reference](/docs/reference/config#go/index.md). ### Module path The `module_path` is the import path users type in their Go code: ``` import "github.com/my-org/my-sdk-go" ``` This path must match your GitHub repository URL. For example, if your repo is `github.com/acme/acme-go`, your module path should be `github.com/acme/acme-go`. ### Versioning considerations If your SDK reaches v2.0.0 or higher, Go requires the major version in the module path (e.g., `github.com/my-org/my-sdk-go/v2`). Plan your versioning strategy early to avoid breaking changes for users. ## Editions Editions allow Stainless to make improvements to SDKs that aren’t backwards-compatible. You can explicitly opt in to new editions when you’re ready. See the [SDK and config editions reference](/docs/reference/editions/index.md) for more information. #### go.2025-10-08 - Initial edition for Go (used by default if no edition is specified) ## Publishing Go installs packages directly from source repositories, so publishing is simpler than other languages—no package registry upload required. Stainless uses [GoReleaser](https://goreleaser.com/) to build and publish your SDK. You need to [link a production repository](/docs/guides/publish#link-production-repos/index.md) where Stainless will push your SDK code. For details on how Stainless opens Release PRs and manages versioning, see [Versioning and releases](/docs/guides/publish#versioning-and-releases/index.md). When you merge a Release PR: 1. Stainless creates a git tag with the version number (e.g., `v1.2.3`) 2. GoReleaser builds and publishes your release 3. The Go module proxy automatically caches your module 4. Your package documentation appears on [pkg.go.dev](https://pkg.go.dev) Once a version is released, it cannot be modified or deleted. The Go module proxy caches releases permanently. If you need to fix a released version, publish a new patch version instead. After your first release, you may need to manually trigger indexing by visiting `https://pkg.go.dev/github.com//` and clicking **Request**. Allow a few minutes for indexing to complete. ## Troubleshooting ### Package not appearing on pkg.go.dev After your first release, manually trigger indexing by visiting `https://pkg.go.dev/github.com//` and clicking **Request**. Allow a few minutes for indexing to complete. ### Users getting “module not found” errors If users report they can’t install your SDK: 1. Verify the GitHub repository is public 2. Check that git tags exist with the `v` prefix (e.g., `v1.0.0`, not `1.0.0`) 3. Ensure the `module_path` in your config matches your repository URL exactly 4. Wait 5-10 minutes for the Go proxy to cache new releases ### Stale versions in user environments Users may have cached old versions. They can clear their local module cache with: Terminal window ``` go clean -modcache ```