Godo

Last verified 21 Oct 2026

Godo is DigitalOcean’s official Go client library for the DigitalOcean API.

Installation

Install the module:

go get github.com/digitalocean/godo

Quickstart

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

More Information

GitHub - digitalocean/godo

The Godo GitHub repository.

github.com
pkg.go.dev reference

Full Go package documentation for Godo.

pkg.go.dev
SDK and Client Libraries

All official and community client libraries.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.