'gounused' finds unused assignements in your code.
The compiler checks for unused variables, but sometimes assignments are never read before getting overwriten or ignored. For example this code:
package main
import "fmt"
func main() {
_, err := fmt.Println("Hello")
_, err = fmt.Println(" world")
_, err = fmt.Println(err)
}
The err variable is used so the compiler does not complain, but the first and third assignment to the err variable are never checked. 'gounused' finds that mistake as follows:
$ gounused ./testdata/
Unused assignment for 'err' ./testdata/test.go:6:5
Unused assignment for 'err' ./testdata/test.go:8:5
$ echo $?
1
Generated by godoc2md