Skip to content

Commit

Permalink
chore: remove log and improve error message for missing packaged go c…
Browse files Browse the repository at this point in the history
…ommand
  • Loading branch information
ryan-gang committed Jul 29, 2024
1 parent 7ab57c3 commit 9609072
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/custom_executable/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ func ReplaceAndBuild(content, outputPath, placeholder, randomString string) erro
file.WriteString(content)

// Run go build command
// ToDo: Remove log
goCmdFullPath := path.Join(os.Getenv("TESTER_DIR"), "go")
if goCmdFullPath == "" {
return fmt.Errorf("CodeCrafters Internal Error: Couldn't find packaged go command")
if goCmdFullPath == "go" {
return fmt.Errorf("CodeCrafters Internal Error: Couldn't find packaged go command.\nTESTER_DIR: %s", os.Getenv("TESTER_DIR"))
}
buildCmd := exec.Command(goCmdFullPath, "build", "-o", outputPath, "tmp.go")
buildCmd.Stdout = io.Discard
Expand Down

0 comments on commit 9609072

Please sign in to comment.