Skip to content

Latest commit

 

History

History

makefile_sample

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

TLDR;

A simple Makefile with some useful rules for go 1.6+ development.

Long read

It's for 1.6+ because takes into account that vendor/ is the dependencies directory, and tries to not execute tests and linters of vendors.

Also has two types of rules for tests and linters: the normal ones and the -ci ones, which are for running within Continuous Integration environements, where we want to stop executing the build as the first thing fails. The latter use fgt is a little go utility needed because not all the linters return the same status code and output when finding issues (source).

Rule types:

  • testing: launch tests excluding vendor packages.
  • linters
  • code coverage, with go-carpet
  • dependency management with godep

Linters

  • fmt
  • imports
  • vet, without alerting when not using composite literals.
  • lint
  • errcheck, without alerting if Close returned errors are not checked. Otherwise you would need to wrap the Close() inside a closure when deferring it (source).

If you need more linters check out gometalinter.