Tomas Vik

Go/Code Review

CodeReviewComments · golang/go Wiki

Go standards and style guidelines | GitLab

Security: Remember to run SAST and Dependency Scanning on your project (or at least the gosec analyzer), and to follow our Security requirements.

Run the goimports command

Don’t accept maps as input or return maps as a part of your Public API (Joe Bonder, Learning Go, Pointers)

  • You don’t know what the keys are and you have to check the code
  • Maps are mutable and you can’t make them immutable

Don’t mutate slices that were passed to a function or document that behaviour (Joe Bonder, Learning Go, Pointers)

Are tests run with -race for race detection?

When you see a buffered channel, what is the reason for the particular size of the buffer?

  • what happens when the sending goroutine blocks?

Resources

  • [[Code Review Antipatterns]] - funny article about how to make other’s life real hard with bad reviews