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

tour: point out using a non-struct package type #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crisman
Copy link
Contributor

@crisman crisman commented Mar 8, 2023

In "tour/methods/3" ("Methods continued") we have the first use of a package local type that is not a struct and not an interface. Thus the code setting variable "f" is somewhat novel and should be highlighted. The slide text also talks about not being able to define methods on "built-in types such as int" which is less interesting as the type wrapped in the example code is "float64".

Point out that that "float64" is among the built-in types to mirror the usage in the code ("methods-continued.go"). Explicitly call attention to the creation of a MyFloat variable for use with a method.

Does some backfill for confusion in golang/tour#191

In "tour/methods/3" ("Methods continued") we have the first use of a
package local type that is not a struct and not an interface.  Thus the
code setting variable "f" is somewhat novel and should be highlighted.
The slide text also talks about not being able to define methods on
"built-in types such as int" which is less interesting as the type
wrapped in the example code is "float64".

Point out that that "float64" is among the built-in types to mirror the
usage in the code ("methods-continued.go"). Explicitly call attention to
the creation of a MyFloat variable for use with a method.

Does some backfill for confusion in golang/tour#191
@gopherbot
Copy link
Contributor

This PR (HEAD: 4bbaefe) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/website/+/474395 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

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.

2 participants