Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No, Go does not provide a REPL.</p> <p>However, as already mentioned, <a href="http://play.golang.org/" rel="nofollow noreferrer">Go Playground</a> (this is the new URL) is very handy. The Go Authors are also thinking about adding a feature-rich editor to it.</p> <p>If you want something local, consider installing <a href="http://labix.org/hsandbox" rel="nofollow noreferrer">hsandbox</a>. Running it simply with <code>hsandbox go</code> will split your terminal screen (with <code>screen</code>) where you can write code at the top and see its execution output at the bottom on every save.</p> <p>There was a <code>gotry</code> among standard Go commands, which used to evaluate expressions (with an optional package name), and could be run like <code>gotry 1+2</code> and <code>gotry fmt 'Println("hello")'</code> from shell. It is no longer available because not many people actually used it.</p> <p>I have also seen third party projects for building a REPL for Go, but now I can only find links to two of them: <a href="https://github.com/sbinet/igo" rel="nofollow noreferrer">igo</a> and <a href="https://github.com/vito/go-repl" rel="nofollow noreferrer">go-repl</a>. How well do they work I don't know.</p> <p>My two cents: Speed of compilation makes writing a REPL possible for Go, as it has also helped building the tools mentioned here, but the same speed makes REPL less necessary. Every time I want to test something in Go that I can't run in Playground I open a simple <code>.go</code> file and start coding and simply run the code. This will be even easier when the <code>go</code> command in Go 1 makes one-command build process possible and way easier.</p> <p><strong>UPDATE:</strong> Latest weekly release of Go added <code>go</code> command which can be used to very easily build a file: write your <code>prog.go</code> file and run <code>go build prog.go &amp;&amp; ./prog</code></p> <p><strong>UPDATE 2</strong>: With Go 1 you can directly run go programs with <code>go run filename.go</code></p> <p><strong>UPDATE 3</strong>: <a href="https://github.com/motemen/gore" rel="nofollow noreferrer"><code>gore</code></a> is a new project which seems interesting.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload