Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
andrewstuart2
on March 18, 2023
|
parent
|
context
|
favorite
| on:
a[low:high:max] in Golang – A Rare Slice Trick
That's just not true. There are immutable arrays in length. [4]int cannot be appended to. The backing of all slices are array types and array doubling is used for appends that go beyond the capacity.
https://go.dev/ref/spec#Array_types
yencabulator
on March 20, 2023
|
next
[–]
No array can change its length, the length is part of the type. There really are no "immutable array"s.
tedunangst
on March 18, 2023
|
prev
[–]
Yeah, that was a mistake.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
https://go.dev/ref/spec#Array_types