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

x/website: some thing out of date at doc/effective_go.html#composite_literals #38154

Closed
luchuanbing123 opened this issue Mar 30, 2020 · 1 comment

Comments

@luchuanbing123
Copy link

What version of Go are you using (go version)?

$ go version

go version go1.14 linux/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

What did you expect to see?

a := [...]string{"no error", "Eio", "invalid argument"}
s := []string{"no error", "Eio", "invalid argument"}
m := map[int]string{1: "no error", 2: "Eio", -1: "invalid argument"}

What did you see instead?

is there some thing out of date
at https://golang.org/doc/effective_go.html#composite_literals

image

@gopherbot gopherbot added this to the Unreleased milestone Mar 30, 2020
@luchuanbing123 luchuanbing123 changed the title x/website: x/website: some thing out of date at doc/effective_go.html#composite_literals Mar 30, 2020
@bcmills
Copy link
Contributor

bcmills commented Mar 30, 2020

These entries are correct. The point of that example is to illustrate that the same syntax can be used for slice or array indices and for map keys.

@bcmills bcmills closed this as completed Mar 30, 2020
@golang golang locked and limited conversation to collaborators Mar 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants