Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sno6/gommand

Easily run Go code straight from your terminal.
https://github.com/sno6/gommand

Last synced: about 2 months ago
JSON representation

Easily run Go code straight from your terminal.

Awesome Lists containing this project

README

        

# gommand

Go one liner program similar to python -c

## How can I get it?

```
go install github.com/sno6/gommand@latest
```

## Examples

Write any Go code in a single line context, gommand will handle your imports and main function for you.

```gommand 'fmt.Println("Hello gommand")'```

You could also quickly serve your current directory in one line.

```gommand 'http.Handle("/", http.FileServer(http.Dir("."))); fmt.Println(http.ListenAndServe(":8080", nil))'```

Quickly find the date.

```gommand 'fmt.Println(time.Now())'```