tour icon indicating copy to clipboard operation
tour copied to clipboard

tour: unnamed struct in example without any introduction

Open tom-leys opened this issue 5 months ago • 0 comments

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

tom-leys avatar Sep 12 '24 05:09 tom-leys