### Install Lago Go Client Package Source: https://github.com/getlago/lago-go-client/blob/main/README.md Installs the Lago Go Client package for use in Go applications. This command fetches version 1 of the client from the GitHub repository. Requires Go modules to be enabled in the project. ```shell go get github.com/getlago/lago-go-client@v1 ``` -------------------------------- ### Install Go Dependencies Source: https://github.com/getlago/lago-go-client/blob/main/README.md Downloads and installs all Go module dependencies specified in the go.mod file. This step is required after cloning the repository to set up the development environment. Requires Go 1.18 or higher. ```shell go mod download ``` -------------------------------- ### Install and Run GolangCI Lint Source: https://github.com/getlago/lago-go-client/blob/main/README.md Installs the golangci-lint tool and runs code quality checks across the project. This helps identify potential issues, style violations, and bugs in the Go code. Requires Go to be installed on the system. ```shell # Install golangci-lint go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.3 # Run linter golangci-lint run ``` -------------------------------- ### Clone Lago Go Client Repository Source: https://github.com/getlago/lago-go-client/blob/main/README.md Clones the Lago Go Client repository from GitHub and navigates to the project directory. This is the first step in setting up a development environment for contributing to the client. Requires Git to be installed on the system. ```shell git clone https://github.com/getlago/lago-go-client.git cd lago-go-client ``` -------------------------------- ### Initialize Lago Client and List Billable Metrics Source: https://github.com/getlago/lago-go-client/blob/main/README.md Demonstrates how to create a Lago client instance with an API key and fetch a list of billable metrics. Shows error handling for API requests and iteration through results. Requires a valid API key and network access to the Lago API. ```go package main import ( "context" "fmt" "log" lago "github.com/getlago/lago-go-client" ) func main() { client := lago.New().SetApiKey("xyz") ctx := context.TODO() // Example: List customers billableMetrics, err := client.BillableMetric().GetList(ctx, &lago.BillableMetricListInput{ Page: 1, PerPage: 10, }) if err != nil { log.Fatalf("Error fetching Billable Metrics: %v", err) } fmt.Println("List of Billable Metrics:") for _, billableMetric := range billableMetrics.BillableMetrics { fmt.Printf("- %s\n", billableMetric.Name) } } ``` -------------------------------- ### Run Lago Go Client Tests Source: https://github.com/getlago/lago-go-client/blob/main/README.md Executes the complete test suite for the Lago Go Client. This command runs all tests in the current directory and subdirectories. Essential for verifying code changes and ensuring compatibility. ```shell go test ./... ``` -------------------------------- ### Format Go Code Source: https://github.com/getlago/lago-go-client/blob/main/README.md Formats all Go source files according to Go's standard formatting guidelines. This command applies consistent code style across the entire project. Should be run before committing code changes. ```shell go fmt ./... ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.