From c2f2d4f68c113820768e1c63fbe9f6dc0de91668 Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Tue, 27 Aug 2024 00:48:52 -0300
Subject: [PATCH] refactor(go): Use single cache namespace (#31039)

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
---
 lib/modules/datasource/go/index.ts | 7 ++++---
 lib/util/cache/package/types.ts    | 1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/modules/datasource/go/index.ts b/lib/modules/datasource/go/index.ts
index a3abb57cf7..19a27faee6 100644
--- a/lib/modules/datasource/go/index.ts
+++ b/lib/modules/datasource/go/index.ts
@@ -48,7 +48,8 @@ export class GoDatasource extends Datasource {
   @cache({
     namespace: `datasource-${GoDatasource.id}`,
     // TODO: types (#22198)
-    key: ({ packageName }: Partial<DigestConfig>) => `${packageName}-digest`,
+    key: ({ packageName }: GetReleasesConfig) =>
+      `getReleases:${packageName}-digest`,
   })
   getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {
     return this.goproxy.getReleases(config);
@@ -65,8 +66,8 @@ export class GoDatasource extends Datasource {
    *  - Call the respective getDigest in github to retrieve the commit hash
    */
   @cache({
-    namespace: GoDatasource.id,
-    key: ({ packageName }: DigestConfig) => `${packageName}-digest`,
+    namespace: `datasource-${GoDatasource.id}`,
+    key: ({ packageName }: DigestConfig) => `getDigest:${packageName}-digest`,
   })
   override async getDigest(
     { packageName }: DigestConfig,
diff --git a/lib/util/cache/package/types.ts b/lib/util/cache/package/types.ts
index cd0496d867..7d999bcd07 100644
--- a/lib/util/cache/package/types.ts
+++ b/lib/util/cache/package/types.ts
@@ -105,7 +105,6 @@ export type PackageCacheNamespace =
   | 'datasource-unity3d'
   | 'github-releases-datasource-v2'
   | 'github-tags-datasource-v2'
-  | 'go'
   | 'merge-confidence'
   | 'preset'
   | 'url-sha256';
-- 
GitLab