GitHub - digitalocean/godo
The Godo GitHub repository.
Last verified 21 Oct 2026
Godo is DigitalOcean’s official Go client library for the DigitalOcean API.
Install the module:
go get github.com/digitalocean/godoAuthenticate 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)
}
}Try using different keywords or simplifying your search terms.