Skip to content
alvinantonius edited this page May 14, 2017 · 2 revisions

Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string. Vet uses heuristics that do not guarantee all reports are genuine problems, but it can find errors not caught by the compilers.

Unlike golint, go vet can find actual errors in the code which not caught by compiler like this for example.

type Menu struct {
	MenuID     int64      `json:"menu_id"`
	ShopID     int64      `json:"shop_id`
	MenuName   string     `json:"menu_name"`
	Position   int64      `json:"position"`
	CreateTime *time.Time `json:"create_time"`
	Status     int64      `json:"status"`
	UpdateBy   int64      `json:"update_by"`
	UpdateTime *time.Time `json:"update_time"`
}

Notice that on ShopID json tag is missing closing double quote " and it's not caught by compiler.

source

Clone this wiki locally