moov-io / iso8583

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

add a method to remove previously set fields from a message #230

Closed ddvk closed 1 year ago

ddvk commented 1 year ago

I have the following use case: I clone an incoming message, then modify some fields and send it back. Due to the spec, some fields should not be send back, so this allows me to remove those fields.

alovak commented 1 year ago

Hey, @ddvk please check this one: https://github.com/moov-io/iso8583/pull/113

in summary it’s not safe to create copy of the message and in the PR comments you can find a suggested way how to copy data you need from one message into another using Unmarshal and Marshal

ddvk commented 1 year ago

ok, thanks, it's just that there are like 50 fields inthe message and i unmarshal only the ones i needed