Skip to content

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

2 participants