go.osrm
go.osrm copied to clipboard
Adds general options and missing options for table request
Codecov Report
Merging #13 into master will increase coverage by
0.27%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #13 +/- ##
==========================================
+ Coverage 96.55% 96.82% +0.27%
==========================================
Files 8 8
Lines 232 252 +20
==========================================
+ Hits 224 244 +20
Misses 4 4
Partials 4 4
Impacted Files | Coverage Δ | |
---|---|---|
nearest.go | 100% <100%> (ø) |
:arrow_up: |
match.go | 100% <100%> (ø) |
:arrow_up: |
types.go | 96.55% <100%> (+0.25%) |
:arrow_up: |
route.go | 100% <100%> (ø) |
:arrow_up: |
options.go | 100% <100%> (ø) |
:arrow_up: |
table.go | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 788b384...7fc54cc. Read the comment docs.
Updated code with proposed changes
First of all, great job to make types reusable in different requests. I have a question: how to be with backward compatibility? My code does the following:
req := osrm.MatchRequest{ Hints: []string{"X","Y"}, }
but new change will break compilation process because I need to change the code:
req := osrm.MatchRequest{ GeneralOptions: osrm.GeneralOptions{ Hints: []string{"X","Y"}, }, }
Yes, this cannot be backward compatible, unless I copy params from the embedded struct GeneralOptions to every request. I thought this was cleaner approach from the standpoint of library, but it is a breaking change in terms of clients using this library. You as a reviewer, must be the judge of that. If you don't want to introduce breaking change, then don't approve this PR, so I can create another one with repeated fields in every request.
First of all, great job to make types reusable in different requests. I have a question: how to be with backward compatibility? My code does the following:
req := osrm.MatchRequest{ Hints: []string{"X","Y"}, }
but new change will break compilation process because I need to change the code:
req := osrm.MatchRequest{ GeneralOptions: osrm.GeneralOptions{ Hints: []string{"X","Y"}, }, }
Yes, this cannot be backward compatible, unless I copy params from the embedded struct GeneralOptions to every request. I thought this was cleaner approach from the standpoint of library, but it is a breaking change in terms of clients using this library. You as a reviewer, must be the judge of that. If you don't want to introduce breaking change, then don't approve this PR, so I can create another one with repeated fields in every request.
I like that PR. But I think maintainers must release a major version of it (for example, v0.2.0) with a notice about the backward-incompatible change.
that PR. But I think maintainers must release a major version of it (for example, v0.2.0) with a notice about the backward-incompatible change.
I didn't yet added changes you requested, about constants type naming, and function for combining duration and distance
Sure, I know that. I said, that I used it like iota by mistake. I'm going to push that change now.