Go one liner program, similar to python -c
go get github.com/sno6/gommand
gommand [code]
gommand 'fmt.Println("Hello, World!")'
You can quickly write and run code without worrying about setting up a go file. gommand auto imports whatever packages are being used by the program so you don't have to worry about it.
Write data to a new file.
gommand 'f, _ := os.Create("file"); f.Write([]byte("hi")); f.Close()'
Run a quick http server on port 8080.
gommand 'http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "hi") }); http.ListenAndServe(":8080",nil)'