transmission line noise

home

Three useful commands? Go / Golang 01

14 Oct 2016

Tagged with Go, Golang, Go Commands

Go vet - fmt - import

Run these from the command line to check your code.


vet

At the commanmd 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.

go vet

fmt

Gofmt is a tool that automatically formats Go source code.

go fmt

goimports

Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones.

goimports -w *.go
comments powered by Disqus