Skip to content

Latest commit

 

History

History
40 lines (22 loc) · 1.21 KB

development.md

File metadata and controls

40 lines (22 loc) · 1.21 KB

Coding flow

Building

You can build your changes with

make

Linting

Run linters as you make your changes. We can recommend using VSCode with the Go addon to have this work automatically.

Official lints are ran with:

make check

This will install linter tools local to the project. Linter versions are changed with tools.go.

Testing

The full test suite is ran with:

make test

This takes a while to run. The test suite uses a fork of gocheck. With gocheck, individual tests can be ran with this form:

go test github.com/tikv/pd/server/api -check.f TestJsonRespondError

Changing APIs

Updating API documentation

We use Swagger 2.0 to automatically generate RESTful API documentation. When a PR involves API changes, you need to update the Go annotations, and the specific format can refer to Declarative Comments Format.

Error responses

Error responses from the server are switching to using errcode codes. The should use the errorResp function. Please look at other places in the codebase that use errorResp.