yaegi

An elegant Go interpreter that executes Go code dynamically

brewmacoslinux
Try with needOr install directly
Source

About

Yet another elegant Go interpreter

Commands

yaegi

Examples

Start an interactive Go REPL session$ yaegi
Execute a Go script file$ yaegi run script.go
Execute inline Go code from command line$ yaegi eval 'fmt.Println("Hello from yaegi")'