Skip to content

Commit 1f252c3

Browse files
authored
Update developer docs (#851)
Problems: - Go style guide is missing guideline on inline error checking - Pull request guide is missing guideline on PR titles Solution: Add guidelines to relevant docs
1 parent b7d421a commit 1f252c3

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

docs/developer/go-style-guide.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,27 @@ func (int required, ...Options) {
200200

201201
## Error Handling
202202

203+
### Prefer inline error handling
204+
205+
When possible, use inline error handling.
206+
207+
DO:
208+
209+
```go
210+
if err := execute(); err != nil {
211+
// handle error
212+
}
213+
```
214+
215+
DO NOT:
216+
217+
```go
218+
err := execute()
219+
if err != nil {
220+
// handle error
221+
}
222+
```
223+
203224
### Do not filter context when returning errors
204225

205226
Preserve error context by wrapping errors as the stack unwinds. Utilize native error wrapping with `fmt.Errorf` and

docs/developer/pull-request.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
## Submitter Guidelines
44

5-
- Fill in [our pull request template](/.github/PULL_REQUEST_TEMPLATE.md).
5+
- Title the PR using customer-focused language. The release notes are generated from PR titles, so the titles should
6+
describe the feature from the user's perspective and avoid implementation details. For example, instead of "Add debug
7+
boolean", write "Support configurable debug mode".
8+
- Fill in [our pull request template](/.github/PULL_REQUEST_TEMPLATE.md).
69
- Make sure to include the issue number in the PR description to automatically close the issue when the PR mergers.
710
See [Closing Issues via Pull Requests](https://github.blog/2013-05-14-closing-issues-via-pull-requests/) for details.
811
- For significant changes, break your changes into a logical series of smaller commits. By approaching the changes

0 commit comments

Comments
 (0)