diff --git a/dist/setup/index.js b/dist/setup/index.js
index 10c204a..7187e0d 100644
--- a/dist/setup/index.js
+++ b/dist/setup/index.js
@@ -93486,6 +93486,10 @@ function parseGoVersionFile(versionFilePath) {
         const match = contents.match(/^go (\d+(\.\d+)*)/m);
         return match ? match[1] : '';
     }
+    else if (path.basename(versionFilePath) === '.tool-versions') {
+        const match = contents.match(/^golang\s+(\d+(\.\d+)*)/m);
+        return match ? match[1] : '';
+    }
     return contents.trim();
 }
 exports.parseGoVersionFile = parseGoVersionFile;
diff --git a/src/installer.ts b/src/installer.ts
index cc0f2dc..cb580ac 100644
--- a/src/installer.ts
+++ b/src/installer.ts
@@ -466,6 +466,9 @@ export function parseGoVersionFile(versionFilePath: string): string {
   ) {
     const match = contents.match(/^go (\d+(\.\d+)*)/m);
     return match ? match[1] : '';
+  } else if (path.basename(versionFilePath) === '.tool-versions') {
+    const match = contents.match(/^golang\s+(\d+(\.\d+)*)/m);
+    return match ? match[1] : '';
   }
 
   return contents.trim();