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

A Tour of Go : Exercise: Slices #1042

Jebbee opened this issue Sep 7, 2020 · 0 comments

A Tour of Go : Exercise: Slices #1042

Jebbee opened this issue Sep 7, 2020 · 0 comments


Copy link

Jebbee commented Sep 7, 2020

What version of Go are you using (go version)?

What did you expect to see?

In exercise-slices.go on the page it would be helpful to explain that in the main function, in the call to pic.Show(Pic) that Pic is a function value being passed to the Show method. At this point in the tutorial we are not exposed to "Function values" yet. I had a difficult time trying to figure out what the values being passed to the Pic function were. With some print statements I saw that the values of dx and dy where both 256. Only when I got to the "Function values" section of the tour did I get it that it was function value being based to Show. I found the code for pic.go and now get how the parameters of Show, dx and dy, get default values of 256.

For those of us new to Go, that can be very confusing.

@ALTree ALTree transferred this issue from golang/go Sep 8, 2020
@dmitshur dmitshur changed the title x/website: A Tour of Go : Exercise: Slices A Tour of Go : Exercise: Slices Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

1 participant