Table of Contents
Preface
Section 1: Getting Up and Running with Go
1
Go Language Basics
Technical requirements
Using the Go Playground
Utilizing Go packages
Declaring a package
Importing a package
Using a package
Package name conflicts
Packages must be used
A Go Hello World
Using Go's variable types
Go's types
Declaring variables
Variable scopes and shadowing
Function/statement variable must be used
Looping in Go
C style
Removing the init statement
Remove the post statement too and you have a while loop
Creating an infinite loop
Using conditionals
if statements
else
Learning about functions
Returning multiple values and named results
Variadic arguments
Anonymous functions
Defining public and private
Using arrays and slices
Arrays
Slices
Extracting ...
Get Go for DevOps now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.