Go in Plain Language: Volume 3 - intro to Structs, Maps, Interfaces, Variadic Functions (Supplemental Exercises for Golang Students)

Go in Plain Language: Volume 3 - intro to Structs, Maps, Interfaces, Variadic Functions (Supplemental Exercises for Golang Students)

by Tony de Araujo

174 pages· 2017
About
This book is the bridge. You're about to cross the bridge from basic concepts in Go to a more advanced paradigm. Without knowing these concepts and thinking about them in a practical way, learning Go becomes almost impossible or very difficult at best.

Volume 3 offers fewer exercises than previous volumes. Time is invested on concepts in a spirally compelling rediscovery of what we thought we knew, but now we know more.

TABLE OF CONTENTS
01- The blank identifier
02- Data types
03- Creating your own types
04- Data type Conversion
05- Checking for types
06- Pointers to memory addresses
07- If: Using declaration statements before condition
08- Switching with an implicit condition
09- Loops
9.1- A standard for loop
9.2- A for loop acting as a while false loop
9.3- A for loop acting as an until true loop
9.4- The Range for loop
9.5- Using a for range loop to iterate over a map
10- Deferring or delaying a statement in a function
10.1- What is defer?
10.2- Deferring can also be used to run a loop in reverse
10.3- Scope in deferring
11- STRUCTS
11.02- To capitalize or not capitalize a struct
11.03- No instantiating necessary in order to use a struct
11.04- Instantiating a blank struct type
11.05- Instantiating a struct type from a declared struct
11.06- Using the keyword new to instantiate a struct
11.07- Summary: Five different ways of instantiating struct
11.08- Creating an ALIAS to a struct using a pointer
11.09- Using METHODOS with structs
11.10- How to pass a type to a receiver by reference
11.11- A method without a receiver
11.12- Receiver functions accept both values and pointers as arguments
11.13- A method can be applied to many types
11.14- No method overloading and what to do about it
11.15- Embedding a struct in another struct –Type embedding
12- INTERFACES – Short introduction as applied to structs
12.1- Introduction
12.2- How to declare an interface
12.3- Using a slice of type reader interface
12.4- Interface summary
13- The MAP data type
13.2- Declaring a map with make
13.3- Adding and editing map items
13.4- Deleting items from a map
13.5- Maps - Testing the presence of a key with a TUPLE assignment
13.5.1- Preamble – What we need to know to understand "testing"
13.5.2- Checking if a key exists
13.6- Maps: Using a for range loop to iterate over a map
14- INTERFACES as argument to functions
14.2- The empty interface type
14.2.1- Printing out the correct data with fmt.Print
14.2.2- Displaying the data type with %T
14.3- Type ASSERTIONS: Extracting the original type from an interface
14.3.1- Why we need type assertion
14.3.2- Further explanation
14.3.3- An assertion example
14.4- The COMMA, OK syntax and how it works
14.4.2- Comma, ok example
14.4.3- Resolving the ok variable
14.5- Using type assertion to branch from an interface parameter
14.5.1- Fixing the problem without using the comma,ok pattern
14.5.2- Using the comma, ok pattern to qualify the input type
14.5.3- The if v, ok := x.(int); ok { pattern
14.6- Type assertion switch
14.7- Using an assertion switch without value assignment
14.8- Review exercise: Using map as an argument
15- Variadic functions
15.1- Passing multiple arguments to a function
15.2- Selecting one argument from all arguments
15.3- Using a loop to print all arguments
15.4- Passing a slice into a variadic function
15.5- Checking the underlying type of arguments in variadic functions
15.6- Using assertions with a slice type on variadic functions
15.6.2- Unpacking the slice from within the empty interface
15.7- Using a variadic parameter of type string
15.8- How to mix other parameters with a variadic paran
15.9- The case for fmt.Print
16- How to input string data from the keyboard
16.2- Introducing OS and BUFIO
16.3- Streams and files
16.4- About NewReader
16.5- About os.Stdin
16.6- About ReadString
16.7- Using a NewReader for multiple input streams

Add me to your collection.

Discuss Go in Plain Language: Volume 3 - intro to Structs, Maps, Interfaces, Variadic Functions (Supplemental Exercises for Golang Students) with other readers

Join or start a book club for Go in Plain Language: Volume 3 - intro to Structs, Maps, Interfaces, Variadic Functions (Supplemental Exercises for Golang Students) on Readfeed. Live chat, shared reading progress, and AI discussion questions — free to get started.

Frequently asked questions

How do I join a book club for Go in Plain Language: Volume 3 - intro to Structs, Maps, Interfaces, Variadic Functions (Supplemental Exercises for Golang Students)?

Sign up free on Readfeed, then browse public clubs or start your own club with Go in Plain Language: Volume 3 - intro to Structs, Maps, Interfaces, Variadic Functions (Supplemental Exercises for Golang Students) as the current read. Invite friends with a share link and discuss together with live chat and AI discussion questions.

Can I discuss Go in Plain Language: Volume 3 - intro to Structs, Maps, Interfaces, Variadic Functions (Supplemental Exercises for Golang Students) with other readers online?

Yes. Readfeed book clubs let you chat live, share progress, and join discussions about Go in Plain Language: Volume 3 - intro to Structs, Maps, Interfaces, Variadic Functions (Supplemental Exercises for Golang Students) with readers worldwide — whether your club is virtual, in-person, or hybrid.

Is Readfeed free?

Yes. Creating an account and joining book clubs is free. Sign up to find readers who love the same books and start discussing today.