blob: 313561e89bd85f0214f1bc81c65372590d5de826 [file] [log] [blame]
// +build ignore
package main
import (
"encoding/json"
"fmt"
"log"
)
func main() {
var data struct {
ID int
Name string
}
err := json.Unmarshal([]byte(`{"ID": 42, "Name": "The answer"}`), &data)
if err != nil {
log.Fatal(err)
}
fmt.Println(data.ID, data.Name)
}