The Best Go REPL Tools and Implementations
Go compiles quickly and go run handles small scripts, but a REPL is more practical for interactive testing and exploration. Here are the best options available today.
gore
gore remains the most mature Go REPL. It’s actively maintained and handles most interactive development workflows.
Install it:
go install github.com/motemen/gore/cmd/gore@latest
Basic usage:
$ gore
gore version 0.5.x :help for help
gore> :import fmt
gore> fmt.Println("hello world!")
hello world!
13
nil
gore>
Gore compiles snippets into a temporary Go program behind the scenes, so you get actual Go semantics. It supports:
- Multi-line input with
:commands :importfor adding packages:docfor quick documentation lookup:typeto inspect types:resetto clear state- Automatic printing of expression results
Common workflow:
gore> :import math
gore> math.Sqrt(16)
4
gore> var x int = 100
gore> x * 2
200
gore> func double(n int) int { return n * 2 }
gore> double(50)
100
The main limitation: gore creates temporary files and compiles each command, so performance isn’t instant. For one-liners it’s fine; for heavy iteration it can feel slow.
go-interactive (gi)
go-interactive is another option, though less commonly used. It’s more experimental but can be faster for quick expressions.
Practical alternatives
If gore feels sluggish, consider:
go runwith temporary files: Createtest.goand rungo run test.gorepeatedly. Fast feedback for small tests.- Unit tests: For anything non-trivial, write actual test files.
go test -run TestName -vis often faster than REPL iteration. go play(online): The Go Playground works for quick expressions without local setup.
Why not use bash/sh directly?
Some developers try piping Go code to go run /dev/stdin. This works but isn’t a true REPL — you lose state between commands and lack the convenience of gore’s :import and introspection commands.
echo 'package main; import ("fmt"); func main() { fmt.Println(1+1) }' | go run /dev/stdin
It’s serviceable for one-off calculations but doesn’t replace an actual REPL for iterative work.
Recommendation
Use gore for interactive exploration and testing. Install it once and keep it in your PATH. For production testing or code that needs to persist, switch to test files or the standard go run workflow. The REPL is a convenience tool — not a replacement for proper testing practices.
The most complete Go REPL I read about is llgoi – see https://groups.google.com/forum/#!msg/golang-nuts/tBzpDtzNXq8/nUZDKx7J3fIJ
It’s a full compiler based on LLVM that creates compiled code **in RAM** and then executes it.
For a more traditional approach, my gomacro http://github.com/cosmos72/gomacro is a faily complete Go REPL written in pure Go, although it still does not cover full 100% of all Go language features
please try https://gorepl.com/ for golang repl and other repls.