Handling Errors in Go CLI Tools
When a Go command-line tool fails, three parties see the failure: the person at the terminal sees a message, the shell or CI script sees the exit code, and you…
Practical guides for developers. Ideas for building and running software.
When a Go command-line tool fails, three parties see the failure: the person at the terminal sees a message, the shell or CI script sees the exit code, and you…
Terraform is an infrastructure-as-code tool. You write configuration files in HCL, the HashiCorp Configuration Language, to declare resources such as…
Python's asyncio library runs coroutines concurrently on one thread. A coroutine is a function defined with async def that can…
The Fetch API is the browser's built-in HTTP client. You call fetch() with a URL. The browser sends the request…
ReferenceError: fetch is not defined means the JavaScript runtime running your code lacks fetch, the built-in function for making HTTP…
When you build a Rust service that does network I/O, you choose an async runtime early in the project. Rust's…
Your frontend calls your backend with fetch. The request works in Postman and curl, but in the browser it fails…
A Tokio service runs many lightweight async tasks on a small number of worker threads. Each task runs until it…
Your API receives JSON from clients you do not control. A user, a script, a scraper, or an automated attacker…
Go's error is a minimal interface: any type with an Error() string method counts as an error. For years the…
Rate limiting caps how many requests a client can send to an API within a time window; exceeding the cap…
When you build a TypeScript app that talks to an HTTP API, you almost always use fetch, the built-in function…
Go has no exceptions. When a function can fail, it returns a description of what went wrong as one of…
Go has no built-in set type, so when you need to answer "is this value already in the collection?", you…
When you secure an API, you enforce two separate rules that fail in separate ways: authentication verifies that the token…