Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update documentation with examples to use Go native types #341

Open
alovak opened this issue Jan 8, 2025 · 2 comments · May be fixed by #342
Open

update documentation with examples to use Go native types #341

alovak opened this issue Jan 8, 2025 · 2 comments · May be fixed by #342
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed

Comments

@alovak
Copy link
Contributor

alovak commented Jan 8, 2025

This module supports the native Go types in data structures. So, instead of *field.String, you can use either *string or string. However, the documentation does not reflect this. It would be great to fix it.

Example:

// define a struct for the authorization request
type AuthorizationRequest struct {
	MTI                  string `index:"0"`
	PrimaryAccountNumber string `index:"2"`
	ProcessingCode       string `index:"3"`
	AmountTransaction    int    `index:"4"`
	TransmissionDateTime string `index:"7"`
	STAN                 string `index:"11"`
	LocalTransactionTime string `index:"12"`
	LocalTransactionDate string `index:"13"`
	ExpirationDate       string `index:"14"`
	// ...
}

The implemented proposal with the details can be found here: #277
If it's needed, here you can find all PRs to see how and what was changed: https://github.com/moov-io/iso8583/issues?q=is%3Aclosed+milestone%3A%22Use+native+Go+types+to+get%2Fset+data+from+ISO+8583+messages%22

@alovak alovak added documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed labels Jan 8, 2025
muddi900 added a commit to muddi900/iso8583 that referenced this issue Jan 9, 2025
@muddi900
Copy link

muddi900 commented Jan 9, 2025

Hello.

I could only find references in the README, which I have changed. The docs directory doesn't seem to have any other.

@alovak
Copy link
Contributor Author

alovak commented Jan 9, 2025

@muddi900 wow! Thank you for your help!

I've noticed that we also need to update statements like this:

data.TransmissionDateTime.Value() => data.TransmissionDateTime. As Value() method is on the *field.String and is not on the string.

@muddi900 muddi900 linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants