mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 18:47:47 +00:00
7461c298dd
Use stringIterator.byteindex as the loop index, and remove stringIterator.rangeindex, as "the index of the loop is the starting position of the current rune, measured in bytes". This patch also fixes the current loop index returned by stringNext, using `it.byteindex' before - not after - `length' is added.
12 lines
137 B
Go
12 lines
137 B
Go
package main
|
|
|
|
func testRangeString() {
|
|
for i, c := range "abcü¢€𐍈°x" {
|
|
println(i, c)
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
testRangeString()
|
|
}
|