Skip to content

Commit

Permalink
adr: 29 Go: Key Recommendations
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Login <[email protected]>
  • Loading branch information
batazor committed Nov 17, 2023
1 parent 8437d24 commit 180db0f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/ADR/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ for information team about cases for updated ADR.
- [ADR-0017](./decisions/0017-profile-guided-optimization.md) - Profile-guided optimization
- [ADR-0027](./decisions/0027-orm-and-golang.md) - ORM and Golang [Cookbook]
- [ADR-0028](./decisions/0028-go-and-debug-concurrency.md) - Go and debug concurrency
- [ADR-0029](./decisions/0029-go-key-recommendations.md) - Go: Key Recommendations
- **Front-end**
- [ADR-0019](./decisions/0019-front-end-testing.md) - Front-end testings
29 changes: 29 additions & 0 deletions docs/ADR/decisions/0029-go-key-recommendations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 29. Go: Key Recommendations

Date: 2023-11-17

## Status

Accepted

## Context

In our quest to enhance the quality and reliability of our Go codebase, we identified the need for robust tools and guidelines.
Effective linting, handling of nil pointers, and adherence to a consistent style guide are essential for maintaining code quality.

## Decision

1. **Adopt `golangci-lint`**: This comprehensive linter will be our primary tool for identifying and fixing issues in our Go code.

2. **Implement `nilaway` by Uber**: To specifically address nil pointer errors,
we will utilize [Uber's `nilaway`](https://github.com/uber-go/nilaway).

3. **Follow the Uber Go Style Guide**: Our coding style will align with the [Uber Go Style Guide](https://github.com/uber-go/guide),
ensuring consistency and adherence to industry best practices.

## Consequences

- **Easier Code Maintenance**: With `golangci-lint`, identifying and fixing stylistic and logical errors becomes more streamlined.
- **Reduced Nil Pointer Errors**: `nilaway` will significantly lower the risk of nil pointer dereferences, one of the common pitfalls in Go.
- **Consistent Coding Style**: By adhering to the Uber Go Style Guide, our codebase will be more uniform and easier to read,
which is beneficial for both current and future team members.

0 comments on commit 180db0f

Please sign in to comment.