Skip to content

Commit

Permalink
Rename Id to ID to be more idiomatic
Browse files Browse the repository at this point in the history
Lars Wiegman committed Oct 10, 2016
1 parent 6d3d0a6 commit 743b7a6
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions microdata.go
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ type PropertyMap map[string]ValueList
type Item struct {
Types []string `json:"type"`
Properties PropertyMap `json:"properties"`
Id string `json:"id,omitempty"`
ID string `json:"id,omitempty"`
}

// addString adds the property, value pair to the properties map. It appends to any
@@ -155,7 +155,7 @@ func (p *parser) readAttr(item *Item, node *html.Node) {

if s, ok := getAttr("itemid", node); ok {
if u, err := p.baseURL.Parse(s); err == nil {
item.Id = u.String()
item.ID = u.String()
}
}
}
2 changes: 1 addition & 1 deletion microdata_test.go
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ func TestParseItemId(t *testing.T) {

data := ParseData(html, t)

result := data.Items[0].Id
result := data.Items[0].ID
expected := "urn:isbn:978-0141196404"
if result != expected {
t.Errorf("Result should have been \"%s\", but it was \"%s\"", expected, result)

0 comments on commit 743b7a6

Please sign in to comment.