init
This commit is contained in:
commit
01c5c905eb
14
LICENSE
Normal file
14
LICENSE
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
Version 2, December 2004
|
||||||
|
|
||||||
|
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim or modified
|
||||||
|
copies of this license document, and changing it is allowed as long
|
||||||
|
as the name is changed.
|
||||||
|
|
||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||||
|
|
10
README.md
Normal file
10
README.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
jsoon
|
||||||
|
=====
|
||||||
|
|
||||||
|
Simple util for to be `python -mjson.tool` replacement. The second in my series
|
||||||
|
of small go programs to implement/replace cool tools I use frequently.
|
||||||
|
|
||||||
|
"jsoon" because it takes a json stream and expands it. Seriously, look at the
|
||||||
|
code; you'd have to really try hard to make a simpler program.
|
||||||
|
|
||||||
|
There are officially more letters in this readme at this point, actually.
|
22
main.go
Normal file
22
main.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
b, err := ioutil.ReadAll(os.Stdin)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal("problem reading stdin", err)
|
||||||
|
}
|
||||||
|
var out bytes.Buffer
|
||||||
|
err = json.Indent(&out, b, "", "\t")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
out.WriteTo(os.Stdout)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user