How to run Go(lang) code directly from terminal/command line?

In command-line, only a project like go-repl would compile/run a multi-line go source code without leaving any .go file behind.
An alternative: gore:

$ gore
Enter one or more lines and hit ctrl-D
func test() string {return "hello"}
println(test())
^D
---------------------------------
hello

(Other repl-like solution are listed in "Does Go provide REPL?")

Or you would need to develop a go wrapper which would internally create a source code and go run it, before deleting it.