Skip to content
AgileLogics
Intermediate 5 min read

Intermediate Projects

Prerequisites: Level 2 — Intermediate

Build these using packages, interfaces, error wrapping, goroutines, and the standard library from Level 2.

1. Concurrent URL Status Checker

Read a list of URLs from a file, check each one concurrently in its own goroutine with an http.Client that has a timeout, and collect the results over a channel. Print each URL's status code (or error) and the total time taken. Use a sync.WaitGroup to know when every check is done.

2. JSON-Backed Contact Book

Build a CLI that adds, lists, and deletes contacts, persisting them to a contacts.json file with encoding/json. Split it into packages (internal/contacts for the logic, main for the CLI) and cover the logic with table-driven tests.

3. Tiny Key-Value HTTP Server

Build a net/http server with GET /keys/{key}, PUT /keys/{key}, and DELETE /keys/{key} routes, storing values in a map guarded by a sync.RWMutex. Log every request with slog, and return proper status codes (404 for a missing key, 204 for a successful delete).

4. Log File Analyzer

Stream a large log file line by line with bufio.Scanner, parse each line into a struct, and report the count of each log level plus the ten most frequent error messages (use the slices package to sort).