Runtime: Go 1.23

Go Online Compiler (Golang 1.23)

Compile and execute Golang 1.23 programs in your browser with Compilra. Prototype goroutines, channels, slices, and pre-supplied os.Stdin readers (bufio.NewScanner, fmt.Scan) inside an isolated cloud container.

Why Use Compilra’s Go Online Compiler?

Go 1.23 Toolchain

Compile and execute Golang packages with slices, maps, interfaces, structs, and standard library modules like fmt, sync, and strings.

Goroutines & Channel Concurrency

Prototype concurrent workers, buffered channels, and sync.WaitGroup patterns directly in an isolated cloud sandbox.

Fast Compilation & Panic Traces

Use Go’s compile-run loop with complete goroutine stack traces if a runtime panic occurs.

How to Use Compilra’s Go Online Compiler

Execute Golang 1.23 programs in four straightforward steps.

Step 01

Declare package main

Start your file with package main, import required standard packages, and write func main().

Step 02

Add Stdin for fmt.Scan or bufio

Enter pre-supplied input values in the Stdin panel before clicking Run when reading from os.Stdin.

Step 03

Run with Go 1.23

Click Run Code to compile and execute your Go binary in an isolated sandbox container.

Step 04

Check Terminal Logs

Inspect fmt output, compiler errors, or panic traces inside the output console.

Worked Example: Go 1.23 Reading os.Stdin with bufio.Scanner

Tokenize words from standard input using bufio.ScanWords and sum parsed integers.

Source CodeGo 1.23
package main

import (
    "bufio"
    "fmt"
    "os"
    "strconv"
)

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Split(bufio.ScanWords)

    count, sum := 0, 0
    for scanner.Scan() {
        val, err := strconv.Atoi(scanner.Text())
        if err == nil {
            count++
            sum += val
        }
    }

    fmt.Printf("Tokens: %d, Sum: %d\n", count, sum)
}
Pre-Supplied Stdin (Input)
10 20 30 40
Verified Output (Stdout)
Tokens: 4, Sum: 100

Place test data inside Standard Input (stdin) before running. bufio.NewScanner(os.Stdin) consumes pre-supplied input until EOF.

Frequently Asked Questions

Which Go version is supported?

Compilra executes code using Go 1.23 with standard library packages (fmt, strings, time, math, sync, etc.) ready to use.

Can I test concurrency with goroutines and channels in Go?

Yes. You can spawn goroutines and synchronize them with channels or sync.WaitGroup within the sandbox execution window.

What is the required package declaration in Go?

Your Go file must declare package main and define a func main() as the program starting point.

How do I read input with fmt.Scan or bufio in Go?

Enter your test data into the Standard Input (stdin) panel before pressing Run—input is pre-supplied rather than typed live. Calls to fmt.Scan(), fmt.Scanln(), or bufio.NewScanner(os.Stdin) will consume that input.

Does Compilra support Go slices, maps, and custom struct methods?

Yes. Slices (make, append, copy), hash maps, custom struct types, interfaces, and pointer receiver methods execute natively in Go 1.23.

How does Compilra handle Go runtime panics and recover()?

Runtime panics (e.g. nil pointer dereference or slice bounds out of range) display the complete goroutine stack trace with source code line numbers in the terminal.

Ready to write and run Go code?

Open Compilra’s Go 1.23 workspace and test slices, structs, and goroutines right in your browser.

Open Go Compiler