From 67a1557863615d4a6af9c1aaf1b6f5f878b8d106 Mon Sep 17 00:00:00 2001 From: Dhadve Yash <109629956+Exar04@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:07:27 +0530 Subject: [PATCH] Updated go.md bash example file --- docs/technologies/go.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/technologies/go.md b/docs/technologies/go.md index 7700f1b..8024ef1 100644 --- a/docs/technologies/go.md +++ b/docs/technologies/go.md @@ -90,10 +90,11 @@ const results = [] // Loop through each line and parse it as JSON and check if it is a result line lines.forEach(line => { const output = JSON.parse(line).Output?.trim() - const valid = output.includes('PASS') || output.includes('FAIL') + if (output === undefined) return + const valid = output.includes("--- PASS") || output.includes("--- FAIL") if(!valid) return - const passed = output.includes('PASS') + const passed = output.includes('--- PASS') // Add the pass/fail status to the array results.push(passed) @@ -103,6 +104,9 @@ lines.forEach(line => { fs.writeFileSync(process.env.UNIT_TEST_OUTPUT_FILE, JSON.stringify(results)) EOF +# removing mod.go before testing the result because if it fails we don't need to remove go.mod manually +rm go.mod + # process results node processGoResults.js