OSM: Add Village field to Address struct #166
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
768b039889
commit
245c8beb69
|
@ -164,7 +164,7 @@ func TestLocation_Assign(t *testing.T) {
|
|||
|
||||
assert.Equal(t, "8G757G9P+", l.ID)
|
||||
assert.Equal(t, "Pink Beach", l.LocTitle)
|
||||
assert.Equal(t, "Crete, Greece", l.LocDescription)
|
||||
assert.Equal(t, "Chrisoskalitissa, Crete, Greece", l.LocDescription)
|
||||
})
|
||||
|
||||
t.Run("NewJersey", func(t *testing.T) {
|
||||
|
|
|
@ -5,6 +5,7 @@ type Address struct {
|
|||
Road string `json:"road"`
|
||||
Suburb string `json:"suburb"`
|
||||
Town string `json:"town"`
|
||||
Village string `json:"village"`
|
||||
City string `json:"city"`
|
||||
Postcode string `json:"postcode"`
|
||||
County string `json:"county"`
|
||||
|
|
|
@ -77,6 +77,8 @@ func (o Location) City() (result string) {
|
|||
result = o.Address.City
|
||||
} else if o.Address.Town != "" {
|
||||
result = o.Address.Town
|
||||
} else if o.Address.Village != "" {
|
||||
result = o.Address.Village
|
||||
} else if o.Address.County != "" {
|
||||
result = o.Address.County
|
||||
} else if o.Address.State != "" {
|
||||
|
|
Loading…
Reference in a new issue