You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In exercise-slices.go on the page https://tour.golang.org/moretypes/18 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. https://github.com/golang/tour/blob/master/pic/pic.go#L27
For those of us new to Go, that can be very confusing.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?https://tour.golang.org/moretypes/18
What did you expect to see?
In
exercise-slices.go
on the page https://tour.golang.org/moretypes/18 it would be helpful to explain that in themain
function, in the call topic.Show(Pic)
thatPic
is a function value being passed to theShow
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 thePic
function were. With some print statements I saw that the values ofdx
anddy
where both256
. Only when I got to the "Function values" section of the tour did I get it that it was function value being based toShow
. I found the code forpic.go
and now get how the parameters ofShow
,dx
anddy
, get default values of256
. https://github.com/golang/tour/blob/master/pic/pic.go#L27For those of us new to Go, that can be very confusing.
The text was updated successfully, but these errors were encountered: