Last active
November 2, 2018 10:00
-
-
Save atedja/04cd6c0e748e5a34b0fe to your computer and use it in GitHub Desktop.
Revisions
-
atedja renamed this gist
May 4, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
atedja created this gist
May 4, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ package main import ( "encoding/json" "fmt" "os" ) func main() { decoder := json.NewDecoder(os.Stdin) decoder.UseNumber() json := make(map[string]interface{}) for { err := decoder.Decode(&json) if err != nil { fmt.Println("caught error") fmt.Println(err) } else { fmt.Println("JSON is:") fmt.Println(json) json = make(map[string]interface{}) } } }