Skip to content
Tutorials Center
My learning

Topics

Lesson 146 of 147 ยท Practice and Review

Go Project Ideas

Thirty Go project ideas in four levels, from command-line tools to concurrent services and systems programming, each with an outline, the skills it trains and a runnable starting skeleton.

Reading about Go teaches you the syntax; building something teaches you Go. The trouble is choosing what to build. A good project is small enough to finish, large enough to need more than one feature of the language, and interesting enough that you want to keep going when it gets hard.

This page lists thirty ideas in four levels. Each has a short outline and the skills it exercises, with links to the lessons that explain them. Two runnable skeletons show how to start so that you are never staring at an empty file. The course's own projects are fully worked examples; these ideas are for you to design yourself.

How to work on a project

  1. Write the smallest version first. A program that does one thing end to end beats a half-finished design. Add features one at a time.
  2. Run it every few minutes. Go compiles quickly, so keep a tight loop of change, run and see.
  3. Test the logic, not the I/O. Put the rules in plain functions and types, then write table-driven tests for them.
  4. Use the standard library first. For most of these ideas flag, encoding/json, net/http, bufio, sort, time and sync are enough.
  5. Finish with polish. Handle errors, add --help, write a README with three example commands, and run go vet.

Level 1: Beginner (one file, a few functions)

These practice variables, control flow, slices, maps and functions.

  1. Unit converter. Read 10 km to miles from the command line. Skills: flag and CLI, maps of conversion factors, error messages for unknown units.
  2. Number guessing game. The computer picks a number; you get hints. Skills: random numbers, user input, loops.
  3. Temperature table. Print Celsius to Fahrenheit for a range with aligned columns. Skills: fmt formatting.
  4. Word and line counter (a small wc). Count lines, words and bytes from a file or standard input. Skills: bufio.
  5. Palindrome and anagram checker. Handle Unicode correctly. Skills: strings and runes, sorting.
  6. Tip and bill splitter. Reads amounts and people. Skills: floats versus integer cents, validation.
  7. Prime sieve and factorizer. Skills: slices, loops, benchmarks with testing.

Level 2: Intermediate (structs, files, interfaces)

These practice structs, methods, interfaces, JSON and error handling.

  1. Contact book. Add, list, search and delete contacts, saved to a JSON file. Skills: JSON, files, errors.
  2. Expense tracker. Record expenses with categories and print a monthly summary. Skills: time, maps, sorting.
  3. Markdown to HTML converter for a small subset (headings, bold, lists). Skills: parsing line by line, text/template, tests.
  4. Log analyzer. Read a web server log and report the top URLs, status code counts and slowest requests. Skills: regexp, maps, sorting.
  5. Quiz game from a CSV file with a time limit. Skills: CSV, timers, context.
  6. Bank or library system with interfaces for storage so you can swap memory for a file. Skills: interface design, custom errors.
  7. Text-based adventure or tic-tac-toe with a computer player. Skills: state machines, structs, recursion for the minimax algorithm.
  8. Tiny shell commands (ls, cat, grep, tree). Skills: os, filepath.WalkDir, flags.
  9. Data structure library with generics: stack, queue, set, LRU cache. Skills: generics, data structures from scratch.

Level 3: Advanced (concurrency and networking)

These practice goroutines, channels, HTTP and databases.

  1. URL shortener with an HTTP API and a persistent store. Skills: http server, REST.
  2. Concurrent web crawler that respects a depth limit and a worker count. Skills: goroutines, sync, context.
  3. File checksum tool. Hash a directory tree in parallel with a worker pool and print duplicates. Skills: crypto and hashing, concurrency patterns.
  4. Chat server over TCP or WebSockets with rooms. Skills: TCP, streaming.
  5. Rate-limited API gateway that proxies requests and limits clients. Skills: httputil.ReverseProxy, rate limiting, middleware.
  6. Job queue with workers and retries, with exponential backoff and a dead-letter list. Skills: channels, timers, resilience patterns.
  7. Key-value store with a write-ahead log and a TCP protocol. Skills: file I/O, sync, parsing.
  8. Notes API with accounts: register, log in, CRUD with SQL. Skills: authentication, database/sql, ORMs and builders.
  9. Email digest sender that collects items and sends a summary on a schedule. Skills: net/smtp, tickers, templates.

Level 4: Expert (systems and design)

These practice performance, protocols and larger architecture.

  1. Your own grep or ripgrep that searches a tree in parallel with regular expressions. Skills: memory use, profiling.
  2. A Redis-like server that speaks a simple text protocol with expiring keys. Skills: protocol parsing, timers, concurrency with a mutex or a single owner goroutine.
  3. A tiny interpreter: a tokenizer, a parser and an evaluator for arithmetic with variables and functions. Skills: interfaces for AST nodes, recursion, errors with positions.
  4. A load tester like ab or hey: send N requests with C workers and report latency percentiles. Skills: HTTP client, sort, histograms.
  5. A distributed counter or leader election demo with several processes talking over loopback. Skills: RPC, timeouts, failure handling, graceful shutdown.

Skeleton 1: a command-line tool with tests built in

Most small tools share the same shape: parse arguments, call a pure function, print. Keeping the logic in a function that returns a value makes it testable. This skeleton for the unit converter (idea 1) already works; you extend the table.

Go Starter: unit converter

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with bufio.Scanner or fmt.Scan), it gets the next line from this box.

The output shows = 6.214 for the first line, 91.440 for 3 ft in centimeters, and three different errors. Next steps: read the request from os.Args with the flag package, add temperature conversion (which needs formulas, not a factor), and write a test file with a table of inputs and expected outputs.

Skeleton 2: a concurrent pipeline

Many advanced ideas (crawler, checksum tool, job queue) are variations of one pattern: a producer feeds jobs into a channel, a pool of workers processes them, and a collector gathers the results. Start from this runnable skeleton and replace the work function with your real task.

Go Starter: worker pool with results

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with bufio.Scanner or fmt.Scan), it gets the next line from this box.

Because the workers finish in any order, the program sorts the results by job id before printing: 0 alpha has 5 bytes, error: job 1: empty input, 2 gamma has 5 bytes and 3 delta has 5 bytes. Notice the rule that prevents leaks: the goroutine that knows all senders are done closes the channel, here the one waiting on the WaitGroup.

Choosing and finishing a project

Pick one idea slightly above your comfort level. If after two evenings you are stuck, cut the scope instead of quitting: remove a feature, not the whole project. When it works, add a test, a README and a go vet run, and put it on a code-hosting site. A finished small project teaches more than three abandoned big ones, and it gives you something concrete to talk about in interviews.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. Why should the logic of a command-line tool live in a function that returns values instead of printing?

    Pure functions that take input and return a result or an error can be checked without capturing output, which keeps tests short.
  2. 2. In the worker-pool skeleton, who should close the results channel?

    Closing from a worker would break the others still sending. The goroutine that knows every sender has finished must close it.
  3. 3. What is the best approach when a project is getting too big?

    A small working version teaches more than a large unfinished one. Add features back one at a time.

Summary

  • Choose a project that is a little beyond your current skill and build the smallest working version first.
  • Keep logic in testable functions; keep I/O at the edges.
  • The standard library covers most ideas: flag, bufio, encoding/json, net/http, sync, time.
  • Producer, workers and collector is the pattern behind crawlers, checksum tools and job queues.
  • Finish projects with tests, error handling and a short README.

Next: Go Reference Overview lists where to look things up once you are building on your own.