diff options
author | Alan Donovan <adonovan@google.com> | 2023-03-06 14:49:45 -0500 |
---|---|---|
committer | Alan Donovan <adonovan@google.com> | 2023-03-06 20:14:56 +0000 |
commit | b72edd12e5e7a2b2dda0cb3e2e2fa360e9386743 (patch) | |
tree | e935079f804edf5a99fdb1cf62105260f6ec7bbb | |
parent | d5669276356fa7d80be2dcae3bfaf3ba0b1f1426 (diff) | |
download | golang-x-tools-b72edd12e5e7a2b2dda0cb3e2e2fa360e9386743.tar.gz |
gopls/internal/lsp/filecache: GOPLS_CACHE -> GOPLSCACHE
The go command doesn't use underscores in environment
variables, so nor should gopls.
Also, document the curious phenomenon that du -sh reports
a larger figure than the budget even when the GC is working.
Change-Id: I156255dc528c7bd700cb76545e9d60e2c4d153fc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/473676
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
-rw-r--r-- | gopls/internal/lsp/filecache/filecache.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gopls/internal/lsp/filecache/filecache.go b/gopls/internal/lsp/filecache/filecache.go index f48eed903..a51098579 100644 --- a/gopls/internal/lsp/filecache/filecache.go +++ b/gopls/internal/lsp/filecache/filecache.go @@ -13,6 +13,9 @@ // // The space budget of the cache can be controlled by [SetBudget]. // Cache entries may be evicted at any time or in any order. +// Note that "du -sh $GOPLSCACHE" may report a disk usage +// figure that is rather larger (e.g. 50%) than the budget because +// it rounds up partial disk blocks. // // The Get and Set operations are concurrency-safe. package filecache @@ -161,7 +164,7 @@ func filename(kind string, key [32]byte) string { func getCacheDir() string { cacheDirOnce.Do(func() { // Use user's preferred cache directory. - userDir := os.Getenv("GOPLS_CACHE") + userDir := os.Getenv("GOPLSCACHE") if userDir == "" { var err error userDir, err = os.UserCacheDir() |