diff --git a/dist/index.js b/dist/index.js
index 74206fb..dd9f2d3 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -2122,7 +2122,7 @@ function addBinToPath() {
             return added;
         }
         let buf = child_process_1.default.execSync('go env GOPATH');
-        if (buf) {
+        if (buf.length > 1) {
             let gp = buf.toString().trim();
             core.debug(`go env GOPATH :${gp}:`);
             if (!fs_1.default.existsSync(gp)) {
diff --git a/src/main.ts b/src/main.ts
index a5caf9b..1023292 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -69,7 +69,7 @@ export async function addBinToPath(): Promise<boolean> {
   }
 
   let buf = cp.execSync('go env GOPATH');
-  if (buf) {
+  if (buf.length > 1) {
     let gp = buf.toString().trim();
     core.debug(`go env GOPATH :${gp}:`);
     if (!fs.existsSync(gp)) {