command module
Version: v0.0.0-...-ec959be Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2017 License: BSD-3-Clause Imports: 15 Imported by: 0


go get [-u]



Gt is a wrapper for “go test” that caches test results.

The usage of “gt” is nearly identical to that of “go test.”

gt [-f] [-l] [arguments for "go test"]

The difference between “gt” and “go test” is that when testing a list of packages, if a package and its dependencies have not changed since the last run, “gt” reuses the previous result.

The -f flag causes gt to treat all test results as uncached, as does the use of any “go test” flag other than -short and -v.

The -l flag causes gt to list the uncached tests it would run.

Cached test results are saved in $CACHE/go-test-cache if $CACHE is set, or else $HOME/Library/Caches/go-test-cache on OS X and $HOME/.cache/go-test-cache on other systems. It is always safe to delete these directories if they become too large.

Gt is an experiment in what it would mean and how well it would work to cache test results. If the experiment proves successful, the functionality may move into the standard go command.


Run (and cache) the strings test:

$ gt strings
ok  	strings	0.436s

List tests in str... without cached results:

$ gt -l str...

Run str... tests:

$ gt str...
ok  	strconv	1.548s
ok  	strings	0.436s (cached)

Force rerun of both:

$ gt -f str...
ok  	strconv	1.795s
ok  	strings	0.629s

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL