blob: a716ef2baea99747c86a8a090f8fada41f5b4fdf [file] [log] [blame]
package main
import (
"encoding/json"
"fmt"
"strings"
)
const blob = `[
{"Title":"Øredev", "URL":"http://oredev.org"},
{"Title":"Strange Loop", "URL":"http://thestrangeloop.com"}
]`
type Item struct {
Title string
URL string
}
func main() {
var items []*Item
json.NewDecoder(strings.NewReader(blob)).Decode(&items)
for _, item := range items {
fmt.Printf("Title: %v URL: %v\n", item.Title, item.URL)
}
}