Description

Book Synopsis

Mark Bates is co-founder and instructor at Gopher Guides, the industry leader for Go training, consulting, and conference workshops. Since 2000, he has worked with some of the world's largest, most innovative companies, including Apple, Uber, and Visa. Mark discovered Go in 2013 and has attended GopherCon and hosted their lightning talks. He has spoken at conferences around the world and is a regular on the Go Time podcast.

Cory LaNou, Gopher Guides cofounder and instructor, is a full stack technologist who has specialized in start-ups for the last 20 years. Cory has deep ties to the Go community, having started one of the very first Go meetups in the world, Denver Gophers. Using his real world experience from working on projects such as InfluxDB, a highly scalable database written in Go, he has published numerous practical Go training courses and articles.



Table of Contents

Foreword xxi
Preface xxiii
Acknowledgments xxxi
About the Authors xxxv

Chapter 1: Modules, Packages, and Dependencies 1
Modules 1
Packages 4
Folders, Files, and Organization 6
Importing Packages and Modules 13
Dependencies 16
Summary 25

Chapter 2: Go Language Basics 27
Go Language Overview 27
Numbers 31
Strings 35
UTF-8 37
Variables 40
Constants 48
Naming Identifiers 51
Printing and Formatting 57
Summary 75

Chapter 3: Arrays, Slices, and Iteration 77
List Types: Arrays and Slices 77
How Slices Work 90
Iteration 104
Summary 110

Chapter 4: Maps and Control Structures 111
Maps 111
If Statements 129
Switch Statements 135
Summary 140

Chapter 5: Functions 141
Function Definitions 141
Variadic Arguments 151
Deferring Function Calls 156
Init 162
Summary 166

Chapter 6: Structs, Methods, and Pointers 167
Structs 167
Methods 176
Pointers 182
Nil Receivers 191
Summary 193

Chapter 7: Testing 195
Testing Basics 195
Code Coverage 202
Table Driven Testing 206
Running Tests 213
Test Helpers 222
Summary 229

Chapter 8: Interfaces 231
Concrete Types versus Interfaces 231
Explicit Interface Implementation 233
Implicit Interface Implementation 234
Before Interfaces 235
Using Interfaces 237
Implementing io.Writer 239
Multiple Interfaces 241
Asserting Interface Implementation 241
The Empty Interface 242
Defining Interfaces 243
Embedding Interfaces 249
Type Assertion 250
Assertions through Switch 252
Using Assertions 255
Summary 257

Chapter 9: Errors 259
Errors as Values 259
Panic 264
Don't Panic 273
Custom Errors 289
Wrapping and Unwrapping Errors 294
Errors As/Is 301
Stack Traces 307
Summary 309

Chapter 10: Generics 311
What Are Generics? 311
Summary 334

Chapter 11: Channels 335
Concurrency and Parallelism 335
Go's Concurrency Model 338
Communicating with Channels 342
Unidirectional Channels 351
Closing Channels 352
Buffered Channels 358
Capturing System Signals with Channels 363
Summary 371

Chapter 12: Context 373
The Context Interface 374
Context Rules 380
Context Nodal Hierarchy 381
Context Values 384
Problems with String Keys 388
Securing Context Keys and Values 393
Cancellation Propagation with Contexts 396
Timeouts and Deadlines 405
Context Errors 408
Listening for System Signals with Context 411
Summary 416

Chapter 13: Synchronization 419
Waiting for Goroutines with a WaitGroup 419
Error Management with Error Groups 433
Data Races 443
Synchronizing Access with a Mutex 447
Performing Tasks Only Once 459
Summary 466

Chapter 14: Working with Files 467
Directory Entries and File Information 467
Walking Directories 473
Skipping Directories and Files 477
Creating Directories and Subdirectories 481
File Path Helpers 484
Creating Multiple Directories 489
Creating Files 492
Fixing the Walk Tests 497
Appending to Files 500
Reading Files 503
Beware of Windows 505
The FS Package 506
Using the FS Interface 510
Mocking a File System 513
Embedding Files 517
Summary 522

Index 523

Go Fundamentals

    Product form

    £26.99

    Includes FREE delivery

    RRP £29.99 – you save £3.00 (10%)

    Order before 4pm tomorrow for delivery by Fri 19 Jun 2026.

    A Paperback / softback by Mark Bates, Cory LaNou


      View other formats and editions of Go Fundamentals by Mark Bates

      Publisher: Pearson Education (US)
      Publication Date: 26/01/2023
      ISBN13: 9780137918300, 978-0137918300
      ISBN10: 0137918305

      Description

      Book Synopsis

      Mark Bates is co-founder and instructor at Gopher Guides, the industry leader for Go training, consulting, and conference workshops. Since 2000, he has worked with some of the world's largest, most innovative companies, including Apple, Uber, and Visa. Mark discovered Go in 2013 and has attended GopherCon and hosted their lightning talks. He has spoken at conferences around the world and is a regular on the Go Time podcast.

      Cory LaNou, Gopher Guides cofounder and instructor, is a full stack technologist who has specialized in start-ups for the last 20 years. Cory has deep ties to the Go community, having started one of the very first Go meetups in the world, Denver Gophers. Using his real world experience from working on projects such as InfluxDB, a highly scalable database written in Go, he has published numerous practical Go training courses and articles.



      Table of Contents

      Foreword xxi
      Preface xxiii
      Acknowledgments xxxi
      About the Authors xxxv

      Chapter 1: Modules, Packages, and Dependencies 1
      Modules 1
      Packages 4
      Folders, Files, and Organization 6
      Importing Packages and Modules 13
      Dependencies 16
      Summary 25

      Chapter 2: Go Language Basics 27
      Go Language Overview 27
      Numbers 31
      Strings 35
      UTF-8 37
      Variables 40
      Constants 48
      Naming Identifiers 51
      Printing and Formatting 57
      Summary 75

      Chapter 3: Arrays, Slices, and Iteration 77
      List Types: Arrays and Slices 77
      How Slices Work 90
      Iteration 104
      Summary 110

      Chapter 4: Maps and Control Structures 111
      Maps 111
      If Statements 129
      Switch Statements 135
      Summary 140

      Chapter 5: Functions 141
      Function Definitions 141
      Variadic Arguments 151
      Deferring Function Calls 156
      Init 162
      Summary 166

      Chapter 6: Structs, Methods, and Pointers 167
      Structs 167
      Methods 176
      Pointers 182
      Nil Receivers 191
      Summary 193

      Chapter 7: Testing 195
      Testing Basics 195
      Code Coverage 202
      Table Driven Testing 206
      Running Tests 213
      Test Helpers 222
      Summary 229

      Chapter 8: Interfaces 231
      Concrete Types versus Interfaces 231
      Explicit Interface Implementation 233
      Implicit Interface Implementation 234
      Before Interfaces 235
      Using Interfaces 237
      Implementing io.Writer 239
      Multiple Interfaces 241
      Asserting Interface Implementation 241
      The Empty Interface 242
      Defining Interfaces 243
      Embedding Interfaces 249
      Type Assertion 250
      Assertions through Switch 252
      Using Assertions 255
      Summary 257

      Chapter 9: Errors 259
      Errors as Values 259
      Panic 264
      Don't Panic 273
      Custom Errors 289
      Wrapping and Unwrapping Errors 294
      Errors As/Is 301
      Stack Traces 307
      Summary 309

      Chapter 10: Generics 311
      What Are Generics? 311
      Summary 334

      Chapter 11: Channels 335
      Concurrency and Parallelism 335
      Go's Concurrency Model 338
      Communicating with Channels 342
      Unidirectional Channels 351
      Closing Channels 352
      Buffered Channels 358
      Capturing System Signals with Channels 363
      Summary 371

      Chapter 12: Context 373
      The Context Interface 374
      Context Rules 380
      Context Nodal Hierarchy 381
      Context Values 384
      Problems with String Keys 388
      Securing Context Keys and Values 393
      Cancellation Propagation with Contexts 396
      Timeouts and Deadlines 405
      Context Errors 408
      Listening for System Signals with Context 411
      Summary 416

      Chapter 13: Synchronization 419
      Waiting for Goroutines with a WaitGroup 419
      Error Management with Error Groups 433
      Data Races 443
      Synchronizing Access with a Mutex 447
      Performing Tasks Only Once 459
      Summary 466

      Chapter 14: Working with Files 467
      Directory Entries and File Information 467
      Walking Directories 473
      Skipping Directories and Files 477
      Creating Directories and Subdirectories 481
      File Path Helpers 484
      Creating Multiple Directories 489
      Creating Files 492
      Fixing the Walk Tests 497
      Appending to Files 500
      Reading Files 503
      Beware of Windows 505
      The FS Package 506
      Using the FS Interface 510
      Mocking a File System 513
      Embedding Files 517
      Summary 522

      Index 523

      Recently viewed products

      © 2026 Book Curl

        • American Express
        • Apple Pay
        • Diners Club
        • Discover
        • Google Pay
        • Maestro
        • Mastercard
        • PayPal
        • Shop Pay
        • Union Pay
        • Visa

        Login

        Forgot your password?

        Don't have an account yet?
        Create account