gocache

command module
v0.0.0-...-b4eff13 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

README

gocache

GoDoc

gocache is a tool to manage go build cache.

Package cacheprog defines the protocol for a GOCACHEPROG program. By default, the go command manages a build cache stored in the file system itself. GOCACHEPROG can be set to the name of a command (with optional space-separated flags) that implements the go command build cache externally. This permits defining a different cache policy. The go command will start the GOCACHEPROG as a subprocess and communicate with it via JSON messages over stdin/stdout. The subprocess's stderr will be connected to the go command's stderr. https://pkg.go.dev/cmd/go/internal/cacheprog

Using

$ go get -tool github.com/reillywatson/gocache@latest
$ GOCACHEPROG="go tool gocache" go install std

or

$ go install github.com/reillywatson/gocache@latest
$ GOCACHEPROG="gocache" go install std

Options

--verbose
$ GOCACHEPROG="go tool gocache --verbose" go install std
[disk] local cache in /Users/xxx/Library/Caches/gocache
[gcs] start to gs://yyyy/cache/v1/arm64/darwin/go1.24.1
[gcs] put success for gs://yyyy/cache/v1/arm64/darwin/go1.24.1/zzz (outputID: aaa, size: 415)
--cache-dir
$ GOCACHEPROG="go tool gocache --verbose --cache-dir=${HOME}/cache/" go install std
[disk] local cache in /Users/xxx/cache
--s3-bucket

Amazon S3 Bucket

$ GOCACHEPROG="go tool gocache --verbose --s3-bucket=yyyy" go install std
--gcs-bucket

Google Cloud Storage Bucket

$ GOCACHEPROG="go tool gocache --verbose --gcs-bucket=yyyy" go install std

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal/cacheprog
Package cacheprog defines the protocol for a GOCACHEPROG program.
Package cacheprog defines the protocol for a GOCACHEPROG program.

Jump to

Keyboard shortcuts

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