New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add structured address #34
Add structured address #34
Conversation
Use context.WithTimeout instead. Add error handling on various levels.
Rename geocoder_test.go to examples/geocoder_example.go. Move the file to its own package to avoid import cycles.
Just realised I still need to update the README.... |
Should be alright now. |
I just realised the build fails because of the Go version. I'm using |
Upgrading Go version is a good idea, given v1.8 is around the corner. |
Right, done. |
Cool, I see "all checks passed". Thinking of my previous PR with failing build and the comments I've seen in the travis config
Could that be a "side effect" of moving the examples in a designated file, which no longer looks like a test? |
mapquest/nominatim/geocoder.go
Outdated
}, nil | ||
} | ||
|
||
func parseFloat(value string) float64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this func and let callers use geo.parseFloat() instead?
osm/osm.go
Outdated
@@ -0,0 +1,60 @@ | |||
// Package osm provides common types for OpneStreetMap used by various providers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo 'OpneStreetMap'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me.
Use geo.ParseFloat in mapquest/nominatim. Fix typo in osm/osm.go
Thanks, merging it then :) |
PR to solve issue #29
It's been a while, but with Christmas, work and family added to the fact I had to sign up for many of the providers, the library supports, look into the documentation of their API, etc...
To sum up the major changes I made:
context.Context
with a timeout instead oftime.After
with the benefit of cleaning up / releasing resources in case the deadline has been reachedgeo.Location
andgeo.Address
togeocoder.go
, where the definition of the interface is placed, since these are part of the interface's contract and also to reduce the LOC inhttp_geocoder.go
ErrNoResults
, this can be now deduced if the returned values arenil, nil
; in case an error has been returned by the provider (only few really do so) it's then translated in the second return valuegeocoder_test.go
toexamples/geocoder_example.go
to not be mistaken with unit tests, because of language specific conventionsIn case of further questions / concerns, I'll be glad to discuss them.
Cheers