Slice bounds out of range when its obviously not

The second number in a slice expression is the index, not the number of characters. You are accessing a[4:1], from a[4] to a[1]

Instead: fmt.Println(a[o-1 : o])

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top