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 getting-started.md #2140

Merged
merged 4 commits into from
May 3, 2022
Merged

Conversation

alan890104
Copy link
Contributor

function rand.Int requires two parameters and returns two value in golang version 1.18.1.

I have:

  • Fixed document error in golang 1.18.1. (see docs)

function rand.Int requires two parameters and returns two value in golang version 1.18.1.
@StevenACoffman
Copy link
Collaborator

Are you sure this is correct? https://pkg.go.dev/math/rand#Rand.Int

@alan890104
Copy link
Contributor Author

Oh I see.

I don't know that the tutorial is using math/rand package, so I use Rand.Int() in package crypto/rand instead.

Sorry for misunderstanding.

@coveralls
Copy link

coveralls commented May 3, 2022

Coverage Status

Coverage remained the same at 74.628% when pulling 3eb24ac on alan890104:patch-1 into 33fe0b9 on 99designs:master.

@StevenACoffman
Copy link
Collaborator

I really appreciate you taking the time to report it, as it means probably others were tripped up by this as well. I know I have accidentally substituted one of those for the other in the past. What do you think of how I reworded it to highlight the package?

@alan890104
Copy link
Contributor Author

alan890104 commented May 3, 2022

Wonderful! Thanks for helping me to learn gqlgen.

Update:

Sorry for late notice.

The code on line 142 should be rndInt := rand.Int(), since package math/rand has only one return.

@StevenACoffman StevenACoffman merged commit 3228f36 into 99designs:master May 3, 2022
@StevenACoffman
Copy link
Collaborator

Thanks!

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.

3 participants