I know about factor and when we exceed some length of underlying array it stops doubling (the length should be at least 512 elements according to recent implementation in go 1.18), my question is why an array is not doubled in the below example where length is much less:
sl := make([]int, 5, 5)
sl = append(sl, 6)
sl = append(sl, 7)
sl = append(sl, 8)
sl = append(sl, 9)
sl = append(sl, 10)
sl = append(sl, 11)
fmt.Println(len(sl), cap(sl)) // 10 20 - as expected
sl2 := make([]int, 5, 5)
sl2 = append(sl2, 6, 7, 8, 9, 10, 11)
fmt.Println(len(sl2), cap(sl2)) // 11 12 - why 12 here?