{"repo":"natefinch/gorram","free":true,"listed":false,"github":"https://github.com/natefinch/gorram","clone":"git clone https://github.com/natefinch/gorram.git","description":"It's like go run for any go function","language":"Go","stars":1050,"topics":["go","golang","code-generation"],"license":"MIT","category":"dev-tools","readme_excerpt":"gorram image: &copy; SubSuid It's like go run for any go function. Automagically understands how to produce an interface from the command line into a Go function. Sometimes, magic is just someone spending more time on something than anyone else might reasonably expect. -Teller Demo Installation Note: gorram depends on having a working go environment to function, since it dynamically analyzes go code in the stdlib and in your GOPATH. Usage Examples Pretty print JSON: Calculate a sha256 sum: How it works The first time you run Gorram with a specific function name, Gorram analyzes the package function and generates a file for use with go run . Gorram intelligently converts stdin and/or cli arguments into arguments for the function. Output is converted similarly to stdout. The code is cached in a local directory so that later runs don't incur the generation overhead. Heuristics By default, Gorram just turns CLI args into function args and prints out the return value of a function using fmt's %v. However, there are some special heuristics that it uses to be smarter about inputs and outputs, based on common go idioms. For example: Gorram understands functions that take a single slice of bytes (or an io.Reader) should read from stdin, or if an argument is specified, the argument is treated as a filename to be read. Return values that are an array of bytes are understood to be intended to be printed with fmt's %x, so that you get 2c37424d58 instead of [44 55 66 77 88] . Gorram unders","default_branch":null,"files":null,"tree":[],"storefront":"/r/natefinch","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/natefinch/gorram/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}