maintner/maintnerd: add --config=devgo to sync from prod data on start-up
This makes maintnerd development easier. The new "devgo" config is
like the production "go" config, but syncs the production data to
local disk before starting, so there's no crazy storm of sync activity
at the beginning.
Change-Id: I7602d7327878683f26e6a5e94c617c01143fbd67
Reviewed-on: https://go-review.googlesource.com/43615
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/maintner/godata/godata.go b/maintner/godata/godata.go
index cdcdffb..559b71e 100644
--- a/maintner/godata/godata.go
+++ b/maintner/godata/godata.go
@@ -39,7 +39,7 @@
// See https://godoc.org/golang.org/x/build/maintner#Corpus for how
// to walk the data structure. Enjoy.
func Get(ctx context.Context) (*maintner.Corpus, error) {
- targetDir := filepath.Join(xdgCacheDir(), "golang-maintner")
+ targetDir := Dir()
if err := os.MkdirAll(targetDir, 0700); err != nil {
return nil, err
}
@@ -51,6 +51,11 @@
return corpus, nil
}
+// Dir returns the directory containing the cached mutation logs.
+func Dir() string {
+ return filepath.Join(xdgCacheDir(), "golang-maintner")
+}
+
// xdgCacheDir returns the XDG Base Directory Specification cache
// directory.
func xdgCacheDir() string {