Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.25 KB

CONTRIBUTING.md

File metadata and controls

59 lines (39 loc) · 1.25 KB

Setting up the environment

Install Go 1.18+

Install go by following relevant directions here.

Modifying/Adding code

Most of the SDK is generated code, and any modified code will be overridden on the next generation. The examples/ directory is an exception and will never be overridden.

Adding and running examples

All files in the examples/ directory are not modified by the Stainless generator and can be freely edited or added to.

# add an example to examples/<your-example>/main.go

package main

func main() {
  // ...
}
go run ./examples/<your-example>

Using the repository from source

To use a local version of this library from source in another project, edit the go.mod with a replace directive. This can be done through the CLI with the following:

go mod edit -replace github.com/OneBusAway/go-sdk=/path/to/go-sdk

Running tests

Most tests require you to set up a mock server against the OpenAPI spec to run the tests.

# you will need npm installed
npx prism mock path/to/your/openapi.yml
go test ./...

Formatting

This library uses the standard gofmt code formatter:

gofmt -s -w .