title: How to run Go(lang) code directly from terminal/command line?
body: <p>I want to run simple go code directly from terminal/command line. For example:</p>
  
  <pre><code>go run "
  package main
  func main() {
  println("hello")
  }
  "
  hello
  </code></pre>
  
  <p>However golang allows code execution only from file. So maybe there are some ways how to emulate it? Like this:</p>
  
  <pre><code>go run file.go &lt; echo "...."
  </code></pre>
  
  <p>But there should be no files after actions above.</p>