Open fgergo opened 8 years ago
Can you elaborate on what trouble you're having? It looks adequately table-aligned in my browser.
I believe the intended way to interpret that table is the line:
Range expression 1st value 2nd value
array or slice a [n]E, *[n]E, or []E index i int a[i] E
Then the way to understand that is for a for-based range loop like
for i, x := v { ... }
where v is of types [n]E
, *[n]E
, or []E
, then the range values produced for i and x (respectively) will be an int
-typed index and its corresponding E
-typed element v[i]
.
CC @griesemer
Attached what I see on win7, latest chrome:
Do you have some Chrome extension modifying your content? Or did you override the browser's monospace to be a proportional font?
Sorry about that! I should have known better: it's highly improbable that the spec is not flawless on golang.org... I definitely set a wrong font somewhere.
Reopening just in case this is worth discussing further. The Go spec is maintained in HTML (not Godoc), so we could reasonably use actual <table>
tags, etc. to make it more accessible to readers with less common setups (e.g., custom font settings, screen readers). Thoughts?
(you most probably asked only the core team, though in case not: I - as a non-representative, acme user - never align with spaces.)
I agree that this should be formatted as an HTML table. I also think this is very low priority.
On https://golang.org/ref/spec if you search for "array or slice" the table is not aligned as a table. I can't tell from this paragraph which is the 1st or the 2nd value in a range expression for different types.
(https://golang.org/doc/effective_go.html#for is clear on the range expression, though it's not the spec.)