-
Notifications
You must be signed in to change notification settings - Fork 137
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 functionality for calculating Aerial Distances #47
Conversation
Thanks for the PR @i-sanyam. Can you please clean up the debug statements and send the final version? |
Sure I will but I have mentioned you in the PR as I am having issue with deciding the delimiter. it isn't working either for |
I have allowed TODOs done
|
Thanks. Will review and merge this week. |
} | ||
|
||
// calculates aerial distance in KMs | ||
func CalculateAerialDistance(l1, l2 Location) (float64, error) { |
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.
can we add reciever here as well?
errString += strconv.FormatFloat(l.Lng, 'f', -1, 64) + " lng out of bounds" | ||
} | ||
|
||
if (errString != "") { |
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.
nit: to be consistent with the code we can remove parantheses for if statements
@i-sanyam. I've made a few minor cosmetic changes to the commit. Since you send the PR from your Please take a look at the changes and if they look fine, I'll merge them. |
Thanks @knadh for the edits! I have gone through them. They look fine to me. And before merging them, due to the simplification in error handling, the test cases' error strings need an update. I have added them in a new PR to TL;DR the simplified error handling does not validate both the locations' coordinates at once but I think that is fine. eg in the case of lat long pair - the user first gets an error that L1 is invalid, the user then fixes L1 and attempts again |
Merged in #53 |
I frequently find myself finding distance between two points on a random website. Will love if this is handled by dns.toys
TODO:
,
because that's how points are available to me eg. 12.670,34.870PS. My first Golang PR
Closes #48