website icon indicating copy to clipboard operation
website copied to clipboard

tour: point out using a non-struct package type

Open crisman opened this issue 1 year ago • 1 comments

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

crisman avatar Mar 08 '23 11:03 crisman

This PR (HEAD: 4bbaefe4f0496a9f95c8d15f1e6314a7b72deb1f) 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

gopherbot avatar Mar 08 '23 11:03 gopherbot