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: Type switches #1461

Open
rvyh opened this issue Mar 6, 2023 · 0 comments · May be fixed by golang/website#207
Open

tour: Type switches #1461

rvyh opened this issue Mar 6, 2023 · 0 comments · May be fixed by golang/website#207

Comments

@rvyh
Copy link

rvyh commented Mar 6, 2023

Context: https://go.dev/tour/methods/16

It says:

"A type switch is like a regular switch statement, but the cases in a type switch specify types (not values), and those values are compared against the type of the value held by the given interface value."

It should be?:

"A type switch is like a regular switch statement, but the cases in a type switch specify types (not values), and those types are compared against the type of the value held by the given interface value."

crisman added a commit to crisman/golang_website that referenced this issue Mar 7, 2023
In "methods/16" ("Type switches") the current slide explicitly says "a
type switch specify types (not values)" and then talks about "those
values" which should be "types". Quoting the spec "A type switch
compares types rather than values."

Replaced "values" with "types" where the slide is talking about types.

Fixes golang/tour#1461
@crisman crisman linked a pull request Mar 7, 2023 that will close this issue
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 a pull request may close this issue.

1 participant