Learn to use the debugger. Not only can you step through the code, but there's a debug console where you can execute expressions while the program's in a certain state. That comes standard with the VSCode Go plugin and in Goland. Answer from mcvoid1 on reddit.com
🌐
GitHub
github.com β€Ί x-motemen β€Ί gore
GitHub - x-motemen/gore: Yet another Go REPL that works nicely. Featured with line editing, code completion, and more. Β· GitHub
gore runs code using go run for each input. Every line entered is evaluated repeatedly (#67), so you can't bind the evaluated time by time.Now(), for example. This implementation also makes the execution fairly slow (#182).
Starred by 5.5K users
Forked by 151 users
Languages Β  Go 97.9% | Makefile 1.8% | Dockerfile 0.3%
🌐
Reddit
reddit.com β€Ί r/golang β€Ί go repl?
r/golang on Reddit: Go REPL?
June 9, 2025 -

I’m new to go, but one of my go to things with python, ruby is to drop into a repl and be able to step by step walk through and inspect code flow and especially object types (again a put with dynamic languages, 1/2 the bugs is you have no clue what someone passed in)

I’m fine with doing prints to console for debugging, but miss the power of being able to come into complicated code base as and just walk through the code and get a mental mapping of how things work and where to go next.

With java there was InteliJ for step by step debugging, but that’s not as powerful because I’m not able to modify the object mid flight and try to call a method or a function again to see how it changes things.

Just wondering, how do you as more seasoned go Devs approach debugging in Go?

Top answer
1 of 14
217

No, Go does not provide a REPL(read–eval–print loop).

However, as already mentioned, Go Playground is very handy. The Go Authors are also thinking about adding a feature-rich editor to it.

If you want something local, consider installing hsandbox. Running it simply with hsandbox go will split your terminal screen (with screen) where you can write code at the top and see its execution output at the bottom on every save.

There was a gotry among standard Go commands, which used to evaluate expressions (with an optional package name), and could be run like gotry 1+2 and gotry fmt 'Println("hello")' from shell. It is no longer available because not many people actually used it.

I have also seen third party projects for building a REPL for Go, but now I can only find links to two of them: igo and go-repl. How well do they work I don't know.

My two cents: Speed of compilation makes writing a REPL possible for Go, as it has also helped building the tools mentioned here, but the same speed makes REPL less necessary. Every time I want to test something in Go that I can't run in Playground I open a simple .go file and start coding and simply run the code. This will be even easier when the go command in Go 1 makes one-command build process possible and way easier.

UPDATE: Latest weekly release of Go added go command which can be used to very easily build a file: write your prog.go file and run go build prog.go && ./prog

UPDATE 2: With Go 1 you can directly run go programs with go run filename.go

UPDATE 3: gore is a new project which seems interesting.

2 of 14
67

Try motemen/gore

Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

https://github.com/motemen/gore

🌐
Go
go.dev β€Ί play
Go Playground - The Go Programming Language
Common problems companies solve with Go Β· Stories about how and why companies use Go
🌐
GitHub
github.com β€Ί thedevsaddam β€Ί go-repl
GitHub - thedevsaddam/go-repl: GO REPL is a simple application promising to write/compile/run code in terminal, inspired by python shell Β· GitHub
GO REPL is a simple application promising to write/compile/run code in terminal, inspired by python shell - thedevsaddam/go-repl
Author Β  thedevsaddam
🌐
Medium
medium.com β€Ί @den.isidoro β€Ί quick-prototyping-with-a-golang-repl-547703885bd8
Quick prototyping with a Golang REPL | by Denis Isidoro | Medium
June 2, 2020 - Quick prototyping with a Golang REPL After developing in Clojure for some time, I miss a REPL when coding in Golang. It turns out we can have a Go REPL connected to our IDE of choice. Why use a …
🌐
Replit
replit.com β€Ί languages β€Ί go
Go Online Compiler & Interpreter - Replit
Write and run Go code using our Go online compiler & interpreter. You can build, share, and host applications right from your browser!
Find elsewhere
🌐
GitHub
github.com β€Ί vito β€Ί go-repl
GitHub - vito/go-repl: A Go REPL. Builds up a source .go file over time, compiles it for output. Β· GitHub
A Go REPL. Builds up a source .go file over time, compiles it for output. - vito/go-repl
Starred by 208 users
Forked by 25 users
Languages Β  Go
🌐
GitHub
github.com β€Ί d4l3k β€Ί go-pry
GitHub - d4l3k/go-pry: An interactive REPL for Go that allows you to drop into your code at any point. Β· GitHub
An interactive REPL for Go that allows you to drop into your code at any point. - d4l3k/go-pry
Starred by 3K users
Forked by 63 users
Languages Β  Go 94.9% | HTML 3.6%
🌐
Hacker News
news.ycombinator.com β€Ί item
Interactive Go REPL | Hacker News
July 15, 2017 - Or is it again a "recompile and rerun everything after each new line is added and pretend to be a REPL"? Or is it maybe something inbetween Β· It's something inbetween. Pretty much the way it works is it dynamically inserts references to all objects/packages/functions in scope at compile time.
🌐
Blogger
diego-pacheco.blogspot.com β€Ί 2018 β€Ί 07 β€Ί writing-simple-repl-in-go.html
Writing a simple REPL in Go
July 13, 2018 - The code makes OS interaction easy we only need to do exec.Command("my Linux command") and that's it we are executing OS level commands and scripts. This happens inside the cls function. In case that we cant find the function on the Map we go to a callback function. So the fallback function will ignore the ENTER key by replacing "\n" on the string.
🌐
Desmondcheong
desmondcheong.com β€Ί blog β€Ί 2021 β€Ί 05 β€Ί 05 β€Ί writing-a-simple-repl-in-go
Writing a simple REPL in Go | Desmond Cheong
May 5, 2021 - In this post I wanted to share a simple read-eval-print-loop (REPL) that I wrote as part of following cstacks' clone of sqlite. I'd done this once in C++, but this time I was writing it in Go. What inspired me to write this post was my amazement at how effortless the whole process was.
🌐
GitHub
github.com β€Ί golobby β€Ί repl
GitHub - golobby/repl: Golang REPL, Prototype as fast as possible Β· GitHub
repl build from ground up to be compatible with go modules, so when you fire up a repl in go project which is a go module project repl instantly identifies your module and imports it as a module with local path, so you can access all your public types and functions.(watch Demo)
Starred by 84 users
Forked by 2 users
Languages Β  Go
🌐
Medium
erik-engheim.medium.com β€Ί repl-development-in-go-with-gore-730ece0f3c3b
REPL Development in Go with Gore. A Julia developer setting up a Julia… | by Erik Engheim | Medium
February 19, 2020 - Rather than looking up all sorts of info in the documentation about what types a function returns and what you can do with it, you can simply try it out in the REPL. For instance, maybe you wonder whether 5.6 is a float64 or float32. Instead of figuring out what term to search for in the Go manual, you can just write:
🌐
GitHub
github.com β€Ί OpenEngineer β€Ί go-repl
GitHub - OpenEngineer/go-repl Β· GitHub
Lightweight Golang REPL library, inspired by GNU Readline.
Starred by 7 users
Forked by 5 users
Languages Β  Go 98.9% | Makefile 1.1%
🌐
DEV Community
dev.to β€Ί toxicwaste β€Ί repl-in-go-real-on-go-4kda
REPL in Go? Real on Go! - DEV Community
May 30, 2025 - package main import "github.com/danyasatsuk/replyme" func main() { app := &replyme.App{ Name: "mysuperapp", Usage: "My awesome application", Commands: []*replyme.Command{ { Name: "hello", Usage: "Prints `Hello, World!` to the screen", Action: func(ctx *replyme.Context) error { ctx.Print("Hello, World!") return nil }, }, }, } err := replyme.Run(app) if err != nil { panic(err) } }
🌐
DEV Community
dev.to β€Ί shrsv β€Ί dbchat-getting-a-toy-repl-going-in-golang-part-2-38md
DBChat: Getting a Toy REPL Going in Golang (Part 2) - DEV Community
January 10, 2025 - So I make a adaption, and turn my main.go to look something like this: package main import ( "fmt" "log" "strings" repl "github.com/openengineer/go-repl" ) const banner = ` β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆ
🌐
DevGenius
blog.devgenius.io β€Ί building-a-go-lang-console-repl-9df49dd33f12
Building a Go(lang) Console/REPL. A Read-Eval-Print Loop (REPL) is a… | by Cheikh seck | Dev Genius
August 2, 2022 - A Read-Eval-Print Loop (REPL) is a computer environment that allows users to explore a programming language. In a REPL environment, code is entered and evaluated by an interpreter.