Checking Websites with Go Workers

Build a Go website checker with one result per task, clear error categories and a bounded worker pool for controlled local HTTP targets.

ProjectGolang

Introduction

Checking Websites with Go Workers is a practical Go project for learners ready to coordinate concurrent work. Help an event organizer check prepared local website entrances before opening. Build a reusable command that makes real HTTP requests and saves one truthful JSON result for every assigned task, including separate tasks that share a URL.

Two Guided Labs first build a complete single-target checker, then share tasks through a small worker pool. One independent Challenge checks a different event route with an upper limit of three workers. Each unit starts with its own environment and data. Allow about 155 minutes, an author estimate including reading and ordinary corrections.

What You Will Learn

After completing this course, you will be able to:

  • retain each task's ID and original URL, producing exactly one result even when another task fails;
  • distinguish HTTP refusal, unexpected content, connection errors and timeouts, including failures while reading a response body;
  • give HTTP requests a finite client timeout and close received response bodies;
  • distribute tasks with goroutines and channels, explain channel-closing ownership, and wait for workers with sync.WaitGroup;
  • collect results without concurrent writes to a shared collection and observe real overlapping requests within the worker limit;
  • save and inspect a complete JSON report, accepting different completion orders and handling empty input or fewer tasks than workers.

Who This Course Is For

This course is for Go learners who want to turn familiar functions and data structures into a useful concurrent command-line tool.

Prerequisites: Basic terminal navigation, Go functions, structs, slices, modules and basic channel syntax, plus Building a Lost and Found API or equivalent HTTP experience. The labs explain goroutines, channel-closing responsibility, sync.WaitGroup, client timeouts and response-body cleanup before use.

Learning environment: LabEx provides Go, starter code, controlled local HTTP targets and a browser-based WebIDE. Use the Workspace terminal to run the checker and read its JSON report without installing Go locally. Commands, target content and program output remain in English.

Frequently Asked Questions

Will I scan public websites?

You check only the prepared local targets, whose delays are finite. This is a one-time checking tool; continuous monitoring, alerts and guarantees for arbitrary Internet conditions are outside the project.

Does one failed target stop the other checks?

Every input task must receive its own result. A server's HTTP refusal differs from a connection error. The client stops waiting for a slow response when its configured timeout expires; the target server may finish processing later. The report preserves the HTTP status when a response was received.

What changes in the Challenge?

The task IDs, URLs and expected content change, and the worker limit becomes three. You reuse the mechanisms practiced in the Guided Labs. Results may arrive in any order; complete task coverage and the concurrency limit still apply.

Teacher

labby
Labby
Labby is the LabEx teacher.

Recommended For You

no data