yaegi

Go interpreter that runs Go code directly without compilation.

brewmacoslinux
Try with needOr install directly
Source

About

Yet another elegant Go interpreter

Commands

yaegi

Examples

run Go code interactively in a REPL$ yaegi
execute a Go script file without compiling$ yaegi script.go
run Go code from a string argument$ yaegi -e 'fmt.Println("Hello World")'
import and use external Go packages in interpreter$ yaegi
test Go snippets quickly without build step$ yaegi -e 'import "math"; fmt.Println(math.Sqrt(16))'