moov-io / iso8583

A golang implementation to marshal and unmarshal iso8583 message.
https://moov.io
Apache License 2.0
353 stars 105 forks source link

sort fields properly #259

Closed alovak closed 1 year ago

alovak commented 1 year ago

This PR fixes the issue with converting subfield indexes (map keys) into int to sort them as ints and then convert them back to string so we can use them as keys for the map.

The issue happened when key 01 (string) converted into 1 (int) and then into 1 (string). Code panic with invalid memory address or nil pointer dereference.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.01% :tada:

Comparison is base (36606f8) 73.49% compared to head (78ade2f) 73.50%.

:exclamation: Current head 78ade2f differs from pull request most recent head 545fc16. Consider uploading reports for the commit 545fc16 to get more accurate results

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #259 +/- ## ========================================== + Coverage 73.49% 73.50% +0.01% ========================================== Files 43 43 Lines 2290 2291 +1 ========================================== + Hits 1683 1684 +1 - Misses 375 377 +2 + Partials 232 230 -2 ``` [see 1 file with indirect coverage changes](https://app.codecov.io/gh/moov-io/iso8583/pull/259/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=moov-io)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.