Strictly speaking, a string in Go is not a composite type, but there are so many Go functions that support strings that I decided to describe strings in more detail in this chapter.
As discussed in Chapter 3, Working with Basic Go Data Types, strings in Go are value types, not pointers as is the case with C strings. Additionally, Go supports UTF-8 strings by default, which means that you do not need to load any special packages or do anything tricky in order to print Unicode characters. However, there are subtle differences between a character, a rune, and a byte, as well as differences between a string and a string literal, which are going to be clarified here.
A Go string is a read-only byte slice that can hold any type of bytes and can have an arbitrary length.
You can define a new string literal as follows:
const sLiteral = "\x99\x42\x32\x55\x50\x35\x23\x50\x29...