Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go interactive shell [duplicate]

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.

like image 412
Kenny Grant Avatar asked Sep 27 '12 10:09

Kenny Grant


1 Answers

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.

like image 75
nemo Avatar answered Sep 23 '22 04:09

nemo