Strings in Go are immutable sequences of bytes.

Unlike languages like Python or Java, they are not internally represented as Unicode. Consequently, when reading strings from files or network connections, there is no conversion step from bytes to internal representation. When writing strings to files, there is no conversion to a code page.

Go strings don’t assume any particular code page. They are just bytes.

Go source code files are always UTF-8 so strings defined in source code are also valid UTF-8 strings.

Additionally, functions in the standard library that involve converting characters to upper-case or lower-case etc. assume that raw bytes represent UTF-8-encoded Unicode strings and perform transformations using Unicode rules.

Note the distinction between string literals delimited by double quotes (aka interpreted literals) as in "bar", and those delimited by backticks (aka raw literals) as in foo. Text between double quotes forms the value of the literal, with a backslash used to escape characters as in "\n" for newline. Text between backticks is treated as uninterpreted (implicitly UTF-8-encoded); in particular, backslashes have no special meaning and the string may contain newlines.

Basic string usage:

https://codeeval.dev/gist/835be5b2055cb49a0d3bc864777d6061

Important standard library packages for working on strings:

Find string in another string

Compare strings