
Lexical elements: Interpreted string literals
A quick note that episode 2 of Cup o’ Go dropped today. Check it out! Picking up where we left off last week, we’re discussing string literals. Last week we talked about raw string literals, which leaves us now with interpreted string literals. To recap: String literals A string literal represents a string constant obtained from concatenating a sequence of characters. There are two forms: raw string literals and interpreted string literals.
Book Review: Go Programming In Easy Steps
Is "Go Programming In Easy Steps" the way to learn Go in 2023?

Lexical elements: Raw string literals
Now that I’ve bored you to death with more about rune literals than you ever asked, let’s take things up a level, and talk about strings. String literals A string literal represents a string constant obtained from concatenating a sequence of characters. There are two forms: raw string literals and interpreted string literals. Raw string literals are character sequences between back quotes, as in `foo`. Within the quotes, any character may appear except back quote.
Book Review: Go Programming Language for Dummies
I review the book "Go Programming Language for Dummies" and offer my recommendation whether you should buy this book to learn Go.

Lexical elements: Rune literals pt 3
Let’s continue our disection of rune literals. If you missed the parts, check them out from Monday when we discussed Unicode, and yesterday when we discussed quoting single characters. Today we’re looking at the various escape sequences supported by the rune literal syntax. Rune literals Several backslash escapes allow arbitrary values to be encoded as ASCII text. There are four ways to represent the integer value as a numeric constant: \x followed by exactly two hexadecimal digits; \u followed by exactly four hexadecimal digits; \U followed by exactly eight hexadecimal digits, and a plain backslash \ followed by exactly three octal digits.

Lexical elements: Rune literals pt 2
Let’s continue our exploration of rune literals, which began on Monday. In summary from Monday, a rune in Go represents a Unicode code point. Continuing from there… Rune literals A rune literal is expressed as one or more characters enclosed in single quotes, as in 'x' or '\n'. Within the quotes, any character may appear except newline and unescaped single quote. A single quoted character represents the Unicode value of the character itself, while multi-character sequences beginning with a backslash encode values in various formats.
Introducing Cup o' Go, the new Go News podcast
Today I’m taking a short break from the discussion of the Go Spec to introduce you to a brand new Go-related podcast that I’m part of: Cup o’ Go. Shay Nehmad and I released our first episode yesterday, and intend to make this a weekly, lighthearted Go news program. Our promise is to help listeners keep up with the latest happenings in the Go community in just 15 minutes per week.
Subscribe to Boldly Go: Daily
Every day I'll send you advice to improve your understanding of Go. Don't miss out! I will respect your inbox, and honor my privacy policy.Unsure? Browse the archive.

Lexical elements: Rune literals pt 1, Intro to Unicode
Runes… Oh boy! This is one of bits of Go that shines for its elegant simplicity, but constantly trips up everyone (myself included). As such, I think this may be a 2-, or maybe even a 3-parter. Let’s get started. Rune literals A rune literal represents a rune constant, an integer value identifying a Unicode code point. If you’re already familiar with Unicode, and have a strong understanding of what a “code point” is, you can probably skip this one.

Lexical elements: Imaginary literals
I understand in principle what imaginary numbers are. I used them during high school and university mathematics classes to get good grades. I’ve never had a practical use for them. I’ve certainly never used them in programming, in Go or otherwise. All that said, I guess it’s cool that Go has first-class support for imaginary numbers, rather than it being an add-on library of some kind. If you’re like me, and have never had the need to write software that understands complex numbers, you might skip today’s email, or better yet, jump over to 3Blue1Brown’s video that explains what complex and imaginary numbers are, and why they’re useful.

Detour: Unary operators & signed numeric literals
I noticed something while writing the last two sections on Integer literals and Floating-point literals, and I’m curious if anyone else noticed. There’s no way to express a negative integer or floating-point literal! If we look specifically at the definition of an decimal literal in EBNF format, we see: decimal_lit = "0" | ( "1" … "9" ) [ [ "_" ] decimal_digits ] . Notably, we do not see this:

Lexical elements: Floating-point literals
Ah, who doesn’t love floating point numbers? Go gives us two ways to define floating point number literals: in decimal, or in hexidecimal. I have never been tempted to write a floating point number literal in hexidecimal. I imagine this is mostly used by those interested in precision control of the IEEE 754 values as understood by the floating point implementation. (If this is something you’ve ever used, I’d love to hear from you: What was your context?