Skip to content

Commit b72edd1

Browse files
committed
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 <[email protected]> Reviewed-by: Robert Findley <[email protected]> TryBot-Result: Gopher Robot <[email protected]> gopls-CI: kokoro <[email protected]>
1 parent d566927 commit b72edd1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gopls/internal/lsp/filecache/filecache.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
//
1414
// The space budget of the cache can be controlled by [SetBudget].
1515
// Cache entries may be evicted at any time or in any order.
16+
// Note that "du -sh $GOPLSCACHE" may report a disk usage
17+
// figure that is rather larger (e.g. 50%) than the budget because
18+
// it rounds up partial disk blocks.
1619
//
1720
// The Get and Set operations are concurrency-safe.
1821
package filecache
@@ -161,7 +164,7 @@ func filename(kind string, key [32]byte) string {
161164
func getCacheDir() string {
162165
cacheDirOnce.Do(func() {
163166
// Use user's preferred cache directory.
164-
userDir := os.Getenv("GOPLS_CACHE")
167+
userDir := os.Getenv("GOPLSCACHE")
165168
if userDir == "" {
166169
var err error
167170
userDir, err = os.UserCacheDir()

0 commit comments

Comments
 (0)