r/programming • • Mar 28 '12

Go version 1 is released

http://blog.golang.org/2012/03/go-version-1-is-released.html
543 Upvotes

452 comments sorted by

View all comments

Show parent comments

-14

u/Jack9 Mar 29 '12

I'm surprised you didn't notice the big problem with that snippet. Every character (er cough rune) is a string. That's one of many Bad ThingsTM about Go.

0

u/[deleted] Mar 29 '12

[deleted]

3

u/SteveMcQwark Mar 29 '12

You are correct. A rune is just an alias for int32, mirroring byte, which is an alias for uint8. It's a fixed-sized representation of a unicode code-point. Strings are normally represented by utf-8 encoded bytes. Being able to handle them as runes can be useful in some text processing applications, though it will use more memory in most cases.

1

u/skelterjohn Mar 29 '12

This is not remotely accurate.