From 490a535ddbea024d249b248009fcec37377a087a Mon Sep 17 00:00:00 2001 From: Philip Peterson Date: Fri, 12 Apr 2024 19:28:04 -0400 Subject: [PATCH] gopls/internal/util/lru: Move cache to its own internal utility in internal/lru This change exposes the LRU cache for use in other modules, such as internal/imports, which may use it in the future to support caching across repeated invocations. --- gopls/internal/filecache/filecache.go | 2 +- {gopls/internal/util => internal}/lru/lru.go | 0 {gopls/internal/util => internal}/lru/lru_fuzz_test.go | 2 +- {gopls/internal/util => internal}/lru/lru_test.go | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename {gopls/internal/util => internal}/lru/lru.go (100%) rename {gopls/internal/util => internal}/lru/lru_fuzz_test.go (94%) rename {gopls/internal/util => internal}/lru/lru_test.go (98%) diff --git a/gopls/internal/filecache/filecache.go b/gopls/internal/filecache/filecache.go index af917578e4f..dd77c08c37f 100644 --- a/gopls/internal/filecache/filecache.go +++ b/gopls/internal/filecache/filecache.go @@ -39,7 +39,7 @@ import ( "time" "golang.org/x/tools/gopls/internal/util/bug" - "golang.org/x/tools/gopls/internal/util/lru" + "golang.org/x/tools/internal/lru" ) // Start causes the filecache to initialize and start garbage gollection. diff --git a/gopls/internal/util/lru/lru.go b/internal/lru/lru.go similarity index 100% rename from gopls/internal/util/lru/lru.go rename to internal/lru/lru.go diff --git a/gopls/internal/util/lru/lru_fuzz_test.go b/internal/lru/lru_fuzz_test.go similarity index 94% rename from gopls/internal/util/lru/lru_fuzz_test.go rename to internal/lru/lru_fuzz_test.go index b82776b25ba..2cf01c10e25 100644 --- a/gopls/internal/util/lru/lru_fuzz_test.go +++ b/internal/lru/lru_fuzz_test.go @@ -7,7 +7,7 @@ package lru_test import ( "testing" - "golang.org/x/tools/gopls/internal/util/lru" + "golang.org/x/tools/internal/lru" ) // Simple fuzzing test for consistency. diff --git a/gopls/internal/util/lru/lru_test.go b/internal/lru/lru_test.go similarity index 98% rename from gopls/internal/util/lru/lru_test.go rename to internal/lru/lru_test.go index 9ffe346257d..270e1d45325 100644 --- a/gopls/internal/util/lru/lru_test.go +++ b/internal/lru/lru_test.go @@ -14,7 +14,7 @@ import ( "testing" "golang.org/x/sync/errgroup" - "golang.org/x/tools/gopls/internal/util/lru" + "golang.org/x/tools/internal/lru" ) func TestCache(t *testing.T) {