JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • ServeMux patterns with methods and wildcards in Go 1.22+

    Go SELF
    60 level,0 lecture
    We break down the updated routing in Go’s standard library: how http.ServeMux in Go 1.22+ can match routes by method and path ( "GET /tasks", "POST /tasks"), supports wildcard segments ( {id}, {path...}), and helps remove manual if checks and URL-string parsing from handlers.
    Open
  • Path parameters {id} and extraction via r.PathValue("id")

    Go SELF
    60 level,1 lecture
    We break down why a resource identifier belongs in the path (for example, /api/v1/tasks/42), how net/http.ServeMux (starting with Go 1.22) matches a segment like { id }, and how to safely extract the value via r . PathValue ( "id" ). We also compare path parameters and query parameters, show an example with multiple parameters, and go over common mistakes.
    Open
  • 404/405 — correct responses and where they are generated

    Go SELF
    60 level,2 lecture
    We break down the semantic difference between 404 and 405 in HTTP, where exactly they are “born” in Go via net/http and ServeMux, how to distinguish a “routing 404” from a “data 404”, when Allow is useful, and how to quickly check behavior with curl. Examples are shown using a training API and handlers ( handler).
    Open
  • Helper parseID: contract, errors, and ValidationError.Fields

    Go SELF
    60 level,3 lecture
    We break down how to extract parsing of the id parameter from handlers into a parseID helper with a single contract ( string → int, error), how to return a typed ValidationError with per-field details in Fields, and how, in a handler, to use errors.As to turn this into a unified JSON error envelope with fields.
    Open
  • Minimizing duplication: HTTP handlers

    Go SELF
    60 level,4 lecture
    We break down a practical “Go way” to clean HTTP handlers: we move the routine (statuses, headers, JSON encoding, a single error format) into a shared adapter, and leave the handlers focused “on the meaning”. We build an error contract via ValidationError and HTTPError, write single response points writeJSON/ writeError (with errors.As), and wire everything up through a function type with a ServeHTTP method.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
  • Game projects
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush