github.com/anthropics/anthropic-sdk-go@v1.70.1/CONTRIBUTING.md (about) 1 ## Contributing to documentation 2 3 The documentation for this SDK lives at [platform.claude.com/docs/en/api/sdks/go](https://platform.claude.com/docs/en/api/sdks/go). To suggest changes, open an issue. 4 5 ## Setting up the environment 6 7 To set up the repository, run: 8 9 ```sh 10 $ ./scripts/bootstrap 11 $ ./scripts/lint 12 ``` 13 14 This will install all the required dependencies and build the SDK. 15 16 You can also [install go 1.22+ manually](https://go.dev/doc/install). 17 18 ## Modifying/Adding code 19 20 Most of the SDK is generated code. Modifications to code will be persisted between generations, but may 21 result in merge conflicts between manual patches and changes from the generator. The generator will never 22 modify the contents of the `lib/` and `examples/` directories. 23 24 ## Adding and running examples 25 26 All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. 27 28 ```go 29 # add an example to examples/<your-example>/main.go 30 31 package main 32 33 func main() { 34 // ... 35 } 36 ``` 37 38 ```sh 39 $ go run ./examples/<your-example> 40 ``` 41 42 ## Using the repository from source 43 44 To use a local version of this library from source in another project, edit the `go.mod` with a replace 45 directive. This can be done through the CLI with the following: 46 47 ```sh 48 $ go mod edit -replace github.com/anthropics/anthropic-sdk-go=/path/to/anthropic-sdk-go 49 ``` 50 51 ## Running tests 52 53 Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. 54 55 ```sh 56 $ ./scripts/mock 57 ``` 58 59 ```sh 60 $ ./scripts/test 61 ``` 62 63 ## Formatting 64 65 This library uses the standard gofmt code formatter: 66 67 ```sh 68 $ ./scripts/format 69 ```