Experimental golang static analysis tool that supports Uber Go Style Guide
A static analysis is a function that inspects a package of Go code and reports a set of diagnostics (typically mistakes in the code), and perhaps produces other results as well, such as suggested refactorings or other facts.
The goal of this tool is to report missing idiomatic conventions in Go code based on Uber Go Style Guide
Will be added later
-
Pointer to Interface
// interface-pointer: var ifacePointer uses pointer to interface var ifacePointer *interface{}
-
Pointer to sync.Mutex
// "mutex-pointer: var lock uses pointer to sync.Mutex" var lock *sync.Mutex
-
Copy Boundary
func SetSlice(slice []Slice) { anotherSlice = slice // "copy-boundary: copies a slice directly" }
-
Channel Size
c := make(chan int, 64) // "chan-size: channel size should be one or none"
- Pointers to Interfaces
- Receivers and Interfaces
- Zero-value Mutexes
- Copy Boundary
- Defer to Clean Up
- Channel Size is One or None
- Start Enums at One
- Error Types
- Error Wrapping
- Don't Panic
- Prefer strconv over fmt
- Avoid string-to-byte conversion
Please read the contributing guideline guideline if you wish to contribute
This projects is licensed under the MIT License