4 ms·
I'd have to agree, that would fit my programming style, however it's not unreasonable for a beginner to think of slices and interfaces as basically "A pointer w
by GhotiFish 11y ago
I'd have to agree, that would fit my programming style, however it's not unreasonable for a beginner to think of slices and interfaces as basically "A pointer with some additional info". So if you have two data-structures that have a slice of the same data, you may conceptualize that as two data-structures pointing to the same data. It's wrong, but it's also not far off.
I do think it's a little surprising that this doesn't work:
func append6(is []int){
append(is, 6);
}
even though it appears to with basic testing.