Senior
Can you give the top 3 things to pay attention to during code review?
sobes.tech AI
Answer from AI
Top 3 things to pay attention to during code review in Go:
-
Readability and code style
- Conformance to Go standards (gofmt, idiomatic Go).
- Clear variable and function names.
- Logical structure and absence of redundancy.
-
Correctness and safety
- Error handling checks.
- Absence of data races and concurrency issues.
- Safe use of pointers and resources.
-
Performance and efficiency
- Optimal use of data structures.
- Avoidance of unnecessary allocations.
- Efficient algorithms and minimization of locking.
Example:
// Check that errors are not ignored
result, err := doSomething()
if err != nil {
return err
}
// Check that the code is readable and clear
// ...
Focusing on these aspects can improve code quality and reliability.