Skip to content

pro-mcode/golang-workbook-development-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoLang Workbook and Development Guide

This repository is a practical Go workbook for self-study, team onboarding, and interview preparation. It is designed to take you from your first Go program to production-oriented topics like testing, concurrency, profiling, web APIs, database access, and project architecture.

No single workbook can literally cover every obscure corner of Go, but this one covers the language, the toolchain, the standard library patterns you will use most, and the professional workflows expected in real Go projects.

What is inside

  • A guided learning path in docs/
  • Hands-on exercises in exercises/
  • Runnable example programs in examples/
  • A practical engineering handbook in DEVELOPMENT_GUIDE.md
  • A quick reference in CHEATSHEET.md
  • A tiny starter app in cmd/hello

Suggested study order

  1. docs/01-introduction-and-setup.md
  2. docs/02-core-syntax-and-types.md
  3. docs/03-control-flow-and-functions.md
  4. docs/04-collections-strings-and-runes.md
  5. docs/05-structs-methods-and-interfaces.md
  6. docs/06-generics-errors-and-testing.md
  7. docs/07-concurrency-and-context.md
  8. docs/08-standard-library-io-and-cli.md
  9. docs/09-http-apis-and-json.md
  10. docs/10-databases-modules-and-tooling.md
  11. docs/11-performance-and-internals.md
  12. docs/12-architecture-patterns-and-next-steps.md
  13. docs/13-advanced-topics-and-appendix.md

How to use this workbook

For each chapter:

  1. Read the chapter notes and skim the code snippets.
  2. Run the matching example program in examples/.
  3. Solve the related exercise file in exercises/.
  4. Write your own variation before moving on.
  5. Summarize the topic in your own words.

Workspace map

.
├── cmd/
│   └── hello/
├── docs/
├── exercises/
├── examples/
│   ├── basics/
│   ├── cli/
│   ├── collections/
│   ├── concurrency/
│   ├── errors/
│   ├── generics/
│   ├── methods/
│   ├── testing/
│   └── webapi/
├── DEVELOPMENT_GUIDE.md
├── CHEATSHEET.md
├── Makefile
└── go.mod

Quick start

Install Go 1.22 or newer, then run:

go version
go run ./cmd/hello
go run ./examples/basics
go run ./examples/collections
go run ./examples/methods
go run ./examples/generics
go run ./examples/errors
go run ./examples/concurrency
go run ./examples/cli --name "Gopher" --n 2
go test ./...
go test -race ./...
go test -bench=. ./examples/testing/pkg/...

You can also use the included Makefile:

make hello
make basics
make test
make race
make bench

Skills this workbook aims to build

  • Reading and writing idiomatic Go
  • Understanding packages, modules, and project layout
  • Modeling data with structs, methods, and interfaces
  • Handling errors explicitly and predictably
  • Writing tests, benchmarks, and fuzz tests
  • Building concurrent and cancelable workflows
  • Working with files, JSON, HTTP, and command-line apps
  • Designing maintainable services and packages
  • Profiling performance and reducing unnecessary allocations

A realistic 8-week study plan

Week 1

  • Chapters 1 and 2
  • Run cmd/hello and examples/basics
  • Complete exercises/01-foundations.md

Week 2

  • Chapters 3 and 4
  • Run examples/collections
  • Practice slice, map, and string problems

Week 3

  • Chapter 5
  • Run examples/methods
  • Complete exercises/02-structs-and-interfaces.md

Week 4

  • Chapter 6
  • Run examples/generics, examples/errors, and go test ./...

Week 5

  • Chapter 7
  • Run examples/concurrency
  • Complete exercises/03-concurrency.md

Week 6

  • Chapters 8 and 9
  • Run examples/cli and examples/webapi
  • Complete exercises/04-web-and-data.md

Week 7

  • Chapters 10 and 11
  • Practice modules, tooling, profiling, and SQL design

Week 8

  • Chapter 12
  • Chapter 13
  • Build a small service or CLI from scratch
  • Review DEVELOPMENT_GUIDE.md

Recommended capstone projects

  • A CLI task tracker with file persistence
  • A REST API with JSON validation and tests
  • A worker-pool job processor with cancellation
  • A URL shortener with an in-memory store, then a SQL store
  • A metrics collector that reads files and serves HTTP endpoints

What to remember about Go

  • Simplicity is a feature, not a limitation.
  • Clear code beats clever code.
  • Small interfaces and explicit errors scale well.
  • Concurrency is powerful, but only when cancellation and ownership are clear.
  • The toolchain is part of the language. Learn it early.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors