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

luchuanbing123 opened this issue Mar 30, 2020 · 1 comment


Copy link

@luchuanbing123 luchuanbing123 commented Mar 30, 2020

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


@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
Copy link

@bcmills 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 Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.