Ben Chuanlong Du's Blog

It is never too late to learn.

String in Golang

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

  1. In Golang, a string is implemented as a struct containing a data pointer (pointing to a read-only slice of bytes) and a length.

  2. Raw string literals, delimited by backticks (back quotes), are interpreted literally. They can contain line breaks, and backslashes have no special meaning.