Skip to content

tour: unnamed struct in example without any introduction #1648

Open
@tom-leys

Description

@tom-leys

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},
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions