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: unnamed struct in example without any introduction #1648

Open
tom-leys opened this issue Sep 12, 2024 · 0 comments
Open

tour: unnamed struct in example without any introduction #1648

tom-leys opened this issue Sep 12, 2024 · 0 comments

Comments

@tom-leys
Copy link

Context: https://go.dev/tour/moretypes/9

In this case you introduce the idea of an unnamed struct (without a type) declared inline with a slice. It's not mentioned at all in the explanation nor introduced in any earlier chapter.

s := []struct {
		i int
		b bool
	}{
		{2, true},
		{3, false},
		{5, true},
		{7, true},
		{11, false},
		{13, true},
	}
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

No branches or pull requests

1 participant