$ mage noVendor
/Users/andrew/go/src/github.com/mcandre/mage-extras/test.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/mageextras_test.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/errcheck.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/gofmt.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/sources.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/gox.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/nakedret.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/vet.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/goimports.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/mageextras.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/packages.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/pathseparator.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/binaries_test.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/sources_test.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/binaries.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/golint.go
/Users/andrew/go/src/github.com/mcandre/mage-extras/install.go
mage-extras defines some reusable task predicates for common workflows, in a platform-agnostic way:
- checking that Go source code actually compiles
- running unit tests
- generating code coverage reports
- linting with assorted Go linting tools
- formatting Go code
- installing and uninstall Go applications
- collecting Go source file paths
- obtaining the GOPATH/bin directory
- referencing all local Go packages
- referencing all local Go commands
- cross-compiling applications with gox or goxcart
- archiving artifacts
- manipulating the path separator as a string
Mage is highly agnostic about workflows. mage-extras is a little more opinionated, introducing some useful conventions on top, such as reliably obtaining a list of non-vendored Go files paths, while allowing developers to customize builds to suit their project needs.
https://godoc.org/github.com/mcandre/mage-extras
- Mage (e.g.,
go get github.com/magefile/mage
)
- karp (e.g.
go get https://github.com/mcandre/karp/...
) for conveniently browsing coverage reports.
- Go 1.11+
- Mage (e.g.,
go get github.com/magefile/mage
) - goimports (e.g.
go get golang.org/x/tools/cmd/goimports
) - golint (e.g.
go get github.com/golang/lint/golint
) - errcheck (e.g.
go get github.com/kisielk/errcheck
) - nakedret (e.g.
go get github.com/alexkohler/nakedret
) - shadow (e.g.
go get -u golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
)
$ go get github.com/mcandre/mage-extras
$ go test
$ mage coverageHTML
$ karp cover.html
$ mage lint
$ mage clean; mage -clean