diff --git a/docs/developer/go-style-guide.md b/docs/developer/go-style-guide.md index 049fb7ad0..6e004d2ce 100644 --- a/docs/developer/go-style-guide.md +++ b/docs/developer/go-style-guide.md @@ -200,6 +200,27 @@ func (int required, ...Options) { ## Error Handling +### Prefer inline error handling + +When possible, use inline error handling. + +DO: + +```go +if err := execute(); err != nil { + // handle error +} +``` + +DO NOT: + +```go +err := execute() +if err != nil { + // handle error +} +``` + ### Do not filter context when returning errors Preserve error context by wrapping errors as the stack unwinds. Utilize native error wrapping with `fmt.Errorf` and diff --git a/docs/developer/pull-request.md b/docs/developer/pull-request.md index 6fc519d02..2809c623f 100644 --- a/docs/developer/pull-request.md +++ b/docs/developer/pull-request.md @@ -2,7 +2,10 @@ ## Submitter Guidelines -- Fill in [our pull request template](/.github/PULL_REQUEST_TEMPLATE.md). +- Title the PR using customer-focused language. The release notes are generated from PR titles, so the titles should + describe the feature from the user's perspective and avoid implementation details. For example, instead of "Add debug + boolean", write "Support configurable debug mode". +- Fill in [our pull request template](/.github/PULL_REQUEST_TEMPLATE.md). - Make sure to include the issue number in the PR description to automatically close the issue when the PR mergers. See [Closing Issues via Pull Requests](https://github.blog/2013-05-14-closing-issues-via-pull-requests/) for details. - For significant changes, break your changes into a logical series of smaller commits. By approaching the changes