Skip to content

x/website: Add an example for arrays with the [...]T{a, b, c, d} syntax #66851

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

Closed
adriancuadrado opened this issue Apr 16, 2024 · 1 comment
Closed

Comments

@adriancuadrado
Copy link

adriancuadrado commented Apr 16, 2024

What is the URL of the page with the issue?

https://go.dev/tour/moretypes/6

What is your user agent?

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

Screenshot

image

What did you do?

I read this article and found this code snippet:

b := [...]string{"Penn", "Teller"}

What did you see happen?

It is equivalent to this:

b := [2]string{"Penn", "Teller"}

but it's more convenient because you don't have to count the number of elements since that is done automatically for you by the compiler.

What did you expect to see?

I think it would be awesome to include this feature in A Tour of Go. More specifically here.

@gopherbot gopherbot added this to the Unreleased milestone Apr 16, 2024
@seankhliao
Copy link
Member

please file this on the your repo https://github.com/golang/tour/issues

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@golang golang locked and limited conversation to collaborators Apr 16, 2025
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