I have no idea why this code always slice bound out of range:
parts := make([]string, 0, len(encodedCode)/4)
for i := 0; i < len(encodedCode); i += 4 {
parts = append(parts, encodedCode[i:4])
}
encodedCode
is string with length always multiply with 4. That mean encodedCode[i:4]
never out of bound.