Skip to content

Instantly share code, notes, and snippets.

@takedajs
Last active April 29, 2016 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takedajs/a23f264a9115bb99dec78575c3b0bb90 to your computer and use it in GitHub Desktop.
Save takedajs/a23f264a9115bb99dec78575c3b0bb90 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/json"
"fmt"
)
type Hoge struct {
$ string
}
func main() {
var jsonStr = `{
"$": "hoge",
}`
var h Hoge
err := json.Unmarshal([]byte(jsonStr), &h)
if err != nil {
panic(err)
}
fmt.Println(h)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment