remove unused custom time type

master
Oliver Tonnhofer 2016-12-08 16:00:51 +01:00
parent ceb84124cd
commit 6469b6c2ff
1 changed files with 6 additions and 21 deletions

View File

@ -15,8 +15,8 @@ type changeFile struct {
type Changeset struct {
Id int `xml:"id,attr"`
CreatedAt IsoTime `xml:"created_at,attr"`
ClosedAt IsoTime `xml:"closed_at,attr"`
CreatedAt time.Time `xml:"created_at,attr"`
ClosedAt time.Time `xml:"closed_at,attr"`
Open bool `xml:"open,attr"`
User string `xml:"user,attr"`
UserId int `xml:"uid,attr"`
@ -30,14 +30,10 @@ type Changeset struct {
}
type Comment struct {
UserId int `xml:"uid,attr"`
User string `xml:"user,attr"`
Date IsoTime `xml:"date,attr"`
Text string `xml:"text"`
}
type IsoTime struct {
time.Time
UserId int `xml:"uid,attr"`
User string `xml:"user,attr"`
Date time.Time `xml:"date,attr"`
Text string `xml:"text"`
}
type Tag struct {
@ -45,17 +41,6 @@ type Tag struct {
Value string `xml:"v,attr"`
}
func (t *IsoTime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
var v string
d.DecodeElement(&v, &start)
parse, err := time.Parse(time.RFC3339, v)
if err != nil {
return err
}
*t = IsoTime{parse}
return nil
}
// ParseAllOsmGz parses all changesets from a .osm.gz file.
func ParseAllOsmGz(change string) ([]Changeset, error) {
file, err := os.Open(change)