Go interactive shell

Kenny Grant picture Kenny Grant · Sep 27, 2012 · Viewed 21.9k times · Source

Possible Duplicate:
Does Go provide REPL?

Does anyone know if there is an REPL (interactive go shell, similar to irb) available for go which allows the user to use import statements? I'd like to be able to do something like this:

$igo import ( 
             "log"
             "mypackage/pkg"
            )
log.Print("hello, world!")
pkg.Print("Hello")
...

I've tried igo but that doesn't seem to support this yet.

Answer

nemo picture nemo · Sep 27, 2012

There is go-eval from the same author as igo.

It's an improvement on the old exp/eval package.

However, I was not able to import packages due to missing symbols, which is probably the reason for igo not supporting the import statement.

It's probably the best to go with compile/execute software as seen on play.golang.org.