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

Fix usage example in README.md #6

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

yaronius
Copy link
Contributor

@yaronius yaronius commented Nov 12, 2021

Now the code example in README is not working, updated it to be runnable. This closes #7


configuration := configuration.New(
configuration.TestEnvironment,
&configuration.Pkcs12{Content: certificate), Password: "p12 password"},
Copy link
Contributor Author

@yaronius yaronius Nov 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we had an extra bracket, removed it


configuration := configuration.New(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed the var so that it doesn't shadow the package


payload := bankid.SignPayload{PersonalNumber: "<INSERT PERSONAL NUMBER>", EndUserIp: "192.168.1.1", UserVisibleData: "Test"}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed the wrong case for payload property


response, err := bankId.Sign(&payload)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need context argument for this method


fmt.Println(response.Collect())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need context argument for Collect() method too


if err != nil {
if response := bankid.UnwrapErrorResponse(err); response != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't find the UnwrapErrorResponse() function, but it works fine if try to cast it (tested)

@NicklasWallgren
Copy link
Collaborator

Thanks for the contribution!

@NicklasWallgren NicklasWallgren merged commit 054ee5a into e-identification:master Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix usage example in README.md
2 participants