Registry /
cloud / hetznercloud-hcloud-go-v2
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
hcloud
✓ github.com/hetznercloud/hcloud-go/v2
Listing servers using the Hetzner Cloud API client.
package main
import (
"context"
"fmt"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)
func main() {
client := hcloud.NewClient(hcloud.WithToken("your-api-token"))
servers, _, err := client.Server.List(context.Background(), hcloud.ServerListOpts{})
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("Found %d servers\n", len(servers))
}
Upgrade
Version history
2.41.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.