Sobes.tech
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:

  1. Readability and code style

    • Conformance to Go standards (gofmt, idiomatic Go).
    • Clear variable and function names.
    • Logical structure and absence of redundancy.
  2. Correctness and safety

    • Error handling checks.
    • Absence of data races and concurrency issues.
    • Safe use of pointers and resources.
  3. 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.

Can you give the top 3 things to pay attention to… - sobes.tech