Is there a REPL (interactive console) in Go like in Python?
Hi everyone! I just started learning Go, coming from Python, and I'm really annoyed by the lack of a familiar interactive console (REPL). In Python, I could just type `python` in the terminal and immediately test small pieces of code, see how functions work, check syntax. This greatly accelerated learning and debugging.
In Go, I'm used to writing like this:
```go
package main
import "fmt"
func main() {
for i := 0; i < 10; i++ {
fmt.Println(i * 2)
}
}
```
And every time I need to check a simple loop or expression, I have to create a `main.go` file, write all the boilerplate with `package main` and `func main()`, then save, compile (`go build`) or run (`go run`). This terribly slows down work when I need to quickly test some idea.
I googled it, but I found
No answers yet.
Log in to leave an answer
Blogs