Go Time: Golang, Software Engineering

How Mat writes HTTP services in Go

Jul 9, 2024
Mat Ryer, with 13 years of experience, shares insights on writing HTTP services in Go. Topics include project approach evolution, optimizing HTTP service routes, error handling, testing practices, and playful banter about 'good cop' and 'bad cop'.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ANECDOTE

Airport Encounter

  • Mat Ryer met Tom Wilkie, CTO of Grafana, at an airport after a missed connection.
  • This encounter led to a discussion about Go and eventually to Mat's current job at Grafana Labs.
ADVICE

Functional Options Pattern

  • Use functional options pattern for constructor arguments to specify only necessary overrides.
  • This approach increases readability by focusing on non-default configurations, according to Johnny Boursiquot.
ADVICE

Centralized Routing

  • Centralize route definitions in a single routes.go file for improved code navigation and API overview.
  • This practice facilitates understanding of the entire API surface and promotes consistency, according to Mat Ryer.
Get the Snipd Podcast app to discover more snips from this episode
Get the app