mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
parent
12dbd06f0a
commit
e57acdca4d
2 changed files with 35 additions and 34 deletions
|
|
@ -127,6 +127,7 @@ func Unmarshal(r io.Reader, val interface{}) os.Error {
|
|||
|
||||
// An UnmarshalError represents an error in the unmarshalling process.
|
||||
type UnmarshalError string
|
||||
|
||||
func (e UnmarshalError) String() string {
|
||||
return string(e);
|
||||
}
|
||||
|
|
@ -232,7 +233,7 @@ func (p *Parser) unmarshal(val reflect.Value, start *StartElement) os.Error {
|
|||
ns := "";
|
||||
i := strings.LastIndex(tag, " ");
|
||||
if i >= 0 {
|
||||
ns, tag = tag[0:i], tag[i+1:len(tag)];
|
||||
ns, tag = tag[0:i], tag[i+1 : len(tag)];
|
||||
}
|
||||
if tag != start.Name.Local {
|
||||
return UnmarshalError("expected element type <" + tag + "> but have <" + start.Name.Local + ">");
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ var rssFeed = Feed{
|
|||
Id: "http://codereview.appspot.com/",
|
||||
Updated: "2009-10-04T01:35:58+00:00",
|
||||
Author: Person{
|
||||
Name: "rietveld"
|
||||
Name: "rietveld",
|
||||
},
|
||||
Entry: []Entry{
|
||||
Entry{
|
||||
|
|
@ -134,7 +134,7 @@ var rssFeed = Feed{
|
|||
},
|
||||
Updated: "2009-10-04T01:35:58+00:00",
|
||||
Author: Person{
|
||||
Name: "email-address-removed"
|
||||
Name: "email-address-removed",
|
||||
},
|
||||
Id: "urn:md5:134d9179c41f806be79b3a5f7877d19a",
|
||||
Summary: Text{
|
||||
|
|
@ -170,7 +170,7 @@ feedback on the right way to get the two values at
|
|||
the top of feeds.py marked NOTE(rsc).
|
||||
|
||||
|
||||
`
|
||||
`,
|
||||
},
|
||||
},
|
||||
Entry{
|
||||
|
|
@ -180,7 +180,7 @@ the top of feeds.py marked NOTE(rsc).
|
|||
},
|
||||
Updated: "2009-10-03T23:02:17+00:00",
|
||||
Author: Person{
|
||||
Name: "email-address-removed"
|
||||
Name: "email-address-removed",
|
||||
},
|
||||
Id: "urn:md5:0a2a4f19bb815101f0ba2904aed7c35a",
|
||||
Summary: Text{
|
||||
|
|
@ -203,8 +203,8 @@ call sites. I also wanted to verify that ExpandTabs was
|
|||
not being used from outside intra_region_diff.py.
|
||||
|
||||
|
||||
`
|
||||
}
|
||||
`,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue