oyvindsk / gommand

Go one liner program. Similar to python -c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gommand

Go one liner program, similar to python -c

How to get it?

go get github.com/sno6/gommand

How to run it?

gommand [code]

Usage

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)'

About

Go one liner program. Similar to python -c

License:MIT License


Languages

Language:Go 100.0%