Back to Home
Tutorials · Go

Go Examples

Eighteen guides that take you from no compiler to a Go web service running under systemd — and every stop between. Install the toolchain, learn the language by building things (a bowling scorer, algebra solvers, Big O side by side), work through full courses in data structures and algorithms and in statistics and regression, try interview problems, follow one Book struct through nine stops, then write real programs: a concurrent fetcher, a chat server, a URL shortener, a blog CMS, a live mortgage app. Every code block is complete and runnable with go run; nothing needs a framework.

The route these guides follow
⬇
Install
go version
✎
Basics
syntax · types
🎳
Lessons
build · refactor
⚙
Projects
net/http · sqlite
☁
Hosting
systemd · nginx
Guides 18
START HERE

A compiler, and the basics.

LESSONS

Learn the language by building something.

Each of these teaches Go through one problem you already understand, and each has “explain it simply” checks along the way. Bowling is the one to do first.

3

Learning to Code by Bowling

A beginner build-along: write a bowling score program with only if and else, then replay it with for loops and a flatter data model — same score, a quarter of the code. A lesson in how to improve code you've already written.

4

Learning Go With Algebra Equations

Six classic algebra problems — linear equations, systems, the quadratic formula, and the equation of a line — each solved the standard way by hand, then again in Go, with a check after every one.

5

College Algebra Refresher

For anyone who hasn't opened an algebra book in years. Seven teach-yourself lessons — exponents, factoring, quadratics, functions, logarithms, inequalities, sequences — each in plain words, worked by hand, practised before the answer is revealed, with the Go program in a drop-down as the answer key.

6

Big O Notation, by Example

A beginner's guide to how code scales. Runnable Go examples for O(1), O(log n), O(n), O(n log n), and O(n²) side by side, a growth table and chart, and a refactor that drops an algorithm from O(n²) to O(n).

7

Data Structures and Algorithms in Go

A ten-module course, from arrays to dynamic programming. In each module you build the structure from scratch — a dynamic array, linked list, ring buffer, hash map, binary search tree, heap, union-find — then solve classic problems with it, and 80 tests tell you when you’re done. Lessons, exercise stubs, tests, and reference solutions, with a download to work in your own editor.

8

Statistics and Regression Analysis in Go

A ten-module course from describing data to fitting and checking models: distributions, the bootstrap, confidence intervals, t-tests and chi-square tests, correlation, simple and multiple regression, diagnostics, and logistic regression. You build every statistic from scratch with the standard library, and 78 tests — with expected values from SciPy and statsmodels — tell you when your numbers are right.

9

Go Interview Questions

Google-style coding problems solved in Go — arrays, strings, trees, graphs, dynamic programming, and design. Each with a statement, example, complete Go solution, explanation, and complexity analysis.

10

Go Structs, Made Concrete

A podcast companion. Follow one library Book from a handful of fields to methods, interfaces, collections, JSON, and concurrent code, and see exactly when Go copies a value — and when two names point at the same thing. Nine stops, quick checks, and a live copy demo.

PROJECTS

Complete programs you can go run the moment you paste them.

HOSTING

Keep a Go web app running.

The same small web server, kept alive across reboots on each operating system. Linux is the one this site runs on — the demo at /goapp/hello/ is that guide's output.

One toolchain, one binary

go build produces a single statically linked executable. Every hosting guide above is really the same three steps — build it, copy it, tell the OS to restart it if it dies — and only the third step differs between systems.

go mod init, go run ., go build. Everything on this page starts with those three commands.