Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Cant execute Golang command #23

Open
atlekbai opened this issue Jun 21, 2020 · 3 comments
Open

Cant execute Golang command #23

atlekbai opened this issue Jun 21, 2020 · 3 comments

Comments

@atlekbai
Copy link

I added Input/Output tests and executed command go run main.go. During the test autograding shows

build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined

I tried to set $GOCACHE and $HOME environmentals, but it didn't work.

@razvanmuscalu
Copy link

It would be nice if Autograde supported Golang, or at least if the GitHub Classroom team can share example configuration on how to use I/O or run-command tests in Golang.

@obedmrTEC
Copy link

Does anyone knows if there's some progress on this? I tried doing golang autograding but still not making it work.

@markpatterson27
Copy link
Contributor

Go needs the HOME environmental variable to be set but autograding runs tests with very few env var set, (just PATH and FORCE_COLOR).

You can set HOME by defining it with each Go test command in autograding.json (or the run field in the GH Classroom test setup interface); e.g.

    {
      "name": "Test Go hello world",
      "setup": "",
      "run": "HOME='/home/runner' go run hello-world.go",
      "input": "",
      "output": "",
      "comparison": "included",
      "timeout": 10,
      "points": 5
    },

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants