Running Go in Zerethon IDE

What Run builds, the time limit, input, tests, and what a run cannot do.

Runs in Zerethon IDE · Go 1.27 Official Go documentation ↗
  • Run (Ctrl/⌘+Enter) builds the entry file — main.go by default — with Go 1.27 together with the other .go files of its folder, then runs the program. Make another file the entry with the ▶ button next to it in the explorer.
  • Build errors appear in the Output tab with the file and line (./main.go:7:2: declared and not used: x); the program is not run.
  • Output and errors appear in the Output tab; what you type in the Input tab is the program's standard input.
  • Building and running together are stopped after 20 seconds. Memory is limited, there is no network, and the project files are read-only (write to /tmp).
  • Run tests (Ctrl/⌘+Shift+Enter) builds and runs every file named test_*.go as its own program. A test passes when it exits with status 0 — call os.Exit(1) or panic to fail it. Go's own go test and *_test.go files are not used.
test_geometry.go
package main

import (
	"fmt"
	"os"
)

func main() {
	if Area(2, 3) != 6 {
		fmt.Println("Area(2, 3) should be 6")
		os.Exit(1)
	}
	fmt.Println("geometry ok")
}
A test for the geometry.go file from “Several files and packages”.

Tip: The editor highlights Go and completes keywords and common library names. There is no formatter or live error checking yet: Run shows the compiler's messages.