Skip to content

Go and Other Languages Failing with "command not found" Error #65

@dong7313

Description

@dong7313

Hi there! I'm having trouble running Go code in the sandbox environment. When I try to execute a simple Go program, I get a go: command not found error. It seems like only Python, C++, and Java are working correctly for me.

What I tried

import requests

code = """
package main
import "fmt"
func main() {
    fmt.Println("hello world")
}
"""

params = {
    'language': 'go',
    'code': code,
    'compile_timeout': 10,
    'run_timeout': 10
}

response = requests.post('http://localhost:8080/run_code', json=params)
print(response.json())

Error I got

{
  "status": "Failed",
  "compile_result": {
    "return_code": 127,
    "stderr": "/bin/bash: go: command not found\n"
  }

}

Questions

Is Go or other languages actually supported in the sandbox?

If yes, what's the correct way to run Go code?

Do I need to use the files parameter instead of code?

Are other languages like Rust, Ruby, etc. also not working?

Note

The documentation says Go should work with two modes: go and go_test, but I can't get either to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions