Reference for the services and methods in Godo, the official Go client for the DigitalOcean API.
Godo
Last verified 6 Nov 2026
Godo is DigitalOcean’s official Go client library for the DigitalOcean API, which lets you programmatically manage Droplets, Kubernetes clusters, databases, and other DigitalOcean resources with conventional HTTP requests.
Installation
Install the module:
go get github.com/digitalocean/godoQuickstart
Authenticate with a personal access token. Set your token as an environment variable before running the example:
export DIGITALOCEAN_TOKEN=<your-api-token>Create a client and list your Droplets:
package main
import (
"context"
"fmt"
"os"
"github.com/digitalocean/godo"
)
func main() {
client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
droplets, _, err := client.Droplets.List(context.Background(), &godo.ListOptions{})
if err != nil {
fmt.Printf("Error: %s\n", err)
return
}
for _, d := range droplets {
fmt.Printf("%d: %s\n", d.ID, d.Name)
}
}