make test- Run all unit tests with race detectionmake test-cover- Run tests with coverage statisticsmake lint- Run golangci-lint with project configurationmake vet- Run go vet static analysismake format- Format code with gofmtgo test ./path/to/package- Run tests for a specific package
- Use
gofmtfor formatting (spaces, not tabs) - Import order: standard library, third-party, local packages (prefix: github.com/gosom/google-maps-scraper)
- Use descriptive variable names (e.g.,
entry,cfg,ctx) - Error handling: return errors, use
fmt.Errorfwith wrapping (%w) - Use struct tags for JSON marshaling:
json:"field_name" - Constants use CamelCase (e.g.,
RunModeFile) - Interface names end with -er suffix (e.g.,
Runner,S3Uploader) - Use context.Context as first parameter in functions
- Prefer early returns to reduce nesting
- Use meaningful package names that reflect their purpose
- Add godoc comments for exported types and functions
- Use
nolintcomments sparingly with explanations - Avoid magic numbers, use named constants or comment them