mirror of
https://github.com/Luzifer/gpxhydrant.git
synced 2024-12-22 20:21:17 +00:00
Fix: Followed linter advice
This commit is contained in:
parent
bb2661f03d
commit
b024d1569d
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// GPX represents the contents of an GPX file
|
||||||
type GPX struct {
|
type GPX struct {
|
||||||
XMLName xml.Name `xml:"gpx"`
|
XMLName xml.Name `xml:"gpx"`
|
||||||
Metadata struct {
|
Metadata struct {
|
||||||
|
@ -24,6 +25,7 @@ type GPX struct {
|
||||||
Waypoints []Waypoint `xml:"wpt"`
|
Waypoints []Waypoint `xml:"wpt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Waypoint represents a single waypoint inside a GPX file
|
||||||
type Waypoint struct {
|
type Waypoint struct {
|
||||||
XMLName xml.Name `xml:"wpt"`
|
XMLName xml.Name `xml:"wpt"`
|
||||||
Latitude float64 `xml:"lat,attr"`
|
Latitude float64 `xml:"lat,attr"`
|
||||||
|
@ -37,6 +39,7 @@ type Waypoint struct {
|
||||||
Type string `xml:"type"`
|
Type string `xml:"type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ParseGPXData reads the contents of the GPX file and returns a parsed version
|
||||||
func ParseGPXData(in io.Reader) (*GPX, error) {
|
func ParseGPXData(in io.Reader) (*GPX, error) {
|
||||||
out := &GPX{}
|
out := &GPX{}
|
||||||
return out, xml.NewDecoder(in).Decode(out)
|
return out, xml.NewDecoder(in).Decode(out)
|
||||||
|
|
Loading…
Reference in a new issue