Some tips about string type in Go.
Summary:
- string is a read-only byte slice
- string is not necessary a valid UTF-8 bytes
- %q is useful when formatting a string
- consider using bytes.Buffer to concatenate a bunch of strings
- take advantage of unicode/utf8 package
Reference:
- https://golang.org/ref/spec The Go Programming Language Specification - The Go Programming Language
- https://blog.golang.org/strings Strings, bytes, runes and characters in Go - The Go Blog
- http://qiita.com/ruiu/items/2bb83b29baeae2433a79 Goでは文字列連結はコストの高い操作 - Qiita
- http://qiita.com/ono_matope/items/d5e70d8a9ff2b54d5c37 Goの文字列結合のパフォーマンス - Qiita
The slides are published on the below URL:
http://go-talks.appspot.com/github.com/hkurokawa/go-slides/string-tips/stringtips.slide