moov-io / iso8583

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

package api problems #170

Closed vtolstov closed 2 years ago

vtolstov commented 2 years ago

I'm try to rewrite old way4 iso8583 parser. Before latest many changes i can Unmarshal data to own message (contains all fields with their types) and after that i can create new message and assign some fields to it from incoming message. Now i see only two methods - GetString and GetBytes, in this case for numeric fields i need to convert from string to int and this is really expensive. Why i cant get native field data type?

Also SetMTI method accept string, but package contains predefined MTI types with custom type, so SetMTI needs additional casting to string type....

alovak commented 2 years ago

@vtolstov Not sure I understand this part:

Now i see only two methods - GetString and GetBytes, in this case for numeric fields i need to convert from string to int and this is really expensive.

We have message.Unmarshal (test) and message.Marshal (test)

I'm not sure that we will keep MTI type. Internally, we do not use them. But I see it's confusing.

vtolstov commented 2 years ago

Yeah thanks, i'm miss that after Unpack I need to call Unmarshal to my struct.