Skip to content

Instantly share code, notes, and snippets.

@Ovinatter
Created December 4, 2014 02:11
Show Gist options
  • Save Ovinatter/909d217d17d68de79249 to your computer and use it in GitHub Desktop.
Save Ovinatter/909d217d17d68de79249 to your computer and use it in GitHub Desktop.
var m Msg
b := []byte(`{"message": "とにかく最高!"}`)
err2 := json.Unmarshal(b, &m)
if err2 != nil {
// fmt.Fprintln(os.Stderr, err2)
fmt.Fprintf(w, string(m))
} else {
fmt.Fprintf(w, string(m))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment