func BuildClient(token string) (*Client, error) {
	if token == "" {
		token = os.Getenv("HCLOUD_TOKEN")
	}
	if token == "" {
		return nil, fmt.Errorf("argument `token` or environment variable `HCLOUD_TOKEN` is required")
	}
	opts := []hcloud.ClientOption{
		hcloud.WithToken(token),
	}
	if endpoint := os.Getenv("HCLOUD_ENDPOINT"); endpoint != "" {
		opts = append(opts, hcloud.WithEndpoint(endpoint))
	}
	return NewClient(opts...), nil
}
BuildClient creates and configures an hcloud client
package hcloud
import (
	"context"
	"fmt"
	"os"
	"github.com/hetznercloud/hcloud-go/hcloud"
)