Skip to content

Commit

Permalink
Railway: Improve function name.
Browse files Browse the repository at this point in the history
  • Loading branch information
geofurlong committed Jun 17, 2024
1 parent cda8c1c commit b3bd1d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/geocode/railway.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func FmtTotalYards(totalYards int, metric bool) string {
return fmt.Sprintf("%dM %04dy", miles, yards)
}

// FmtMileages takes two total yards values and returns a formatted miles / yards or kilometre string.
func FmtMileages(tyFrom int, tyTo int, metric bool) string {
// FmtLinear takes two total yards values and returns a formatted miles / yards or kilometre string.
func FmtLinear(tyFrom int, tyTo int, metric bool) string {
return FmtTotalYards(tyFrom, metric) + " to " + FmtTotalYards(tyTo, metric)
}
2 changes: 1 addition & 1 deletion pkg/geocode/railway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ func TestFmtMileages(t *testing.T) {
}

for _, c := range cases {
res := FmtMileages(c.tyFrom, c.tyTo, c.metric)
res := FmtLinear(c.tyFrom, c.tyTo, c.metric)
if res != c.expectedString {
t.Errorf("FmtMileages(%v, %v, %v) = %v, want %v", c.tyFrom, c.tyTo, c.metric, res, c.expectedString)
}
Expand Down

0 comments on commit b3bd1d6

Please sign in to comment.