Here is an example with two concurrent background workers sleeping for different durations, observed by the main test goroutine.
package worker_test
import (
"testing"
"testing/synctest"
"time"
)| # ignore changes to the local .agents/ and docs/ directories + ignore *.lock files | |
| hunk diff -- . ':!.agents' ':!docs/' ':!*.lock' | |
| # https://www.hunk.dev/ | |
| # https://github.com/modem-dev/hunk |
Here is an example with two concurrent background workers sleeping for different durations, observed by the main test goroutine.
package worker_test
import (
"testing"
"testing/synctest"
"time"
)| mkdir -p ~/Music/Dusk_And_Her_Embrace && for f in "/Volumes/Dusk... And Her Embrace/"*.aiff; do ffmpeg -i "$f" -c:a flac -compression_level 12 ~/Music/Dusk_And_Her_Embrace/"$(basename "${f%.aiff}").flac"; done |
| npm install --global @mermaid-js/mermaid-cli | |
| # -s is the scale (i.e. larger dimensions) | |
| mmdc -i input.mmd -o output.png -b white -s 2 |
A Common Table Expression (CTE) in MySQL is a temporary result set that you can reference within a SELECT, INSERT, UPDATE, or DELETE statement.
Think of it as a temporary view that exists only for the duration of that single query. It allows you to write cleaner, more readable SQL by breaking down complex queries into smaller, modular building blocks.
CTEs were introduced in MySQL 8.0, so you will need that version or higher to use them.
livenessProbe: tells Kubernetes whether the container is still alive. If it fails repeatedly, Kubernetes restarts the container.readinessProbe: tells Kubernetes whether the container is ready to receive traffic. If it fails, the pod stays running but is removed from Service load balancing.startupProbe: tells Kubernetes whether the app has finished starting up. While it is still failing, Kubernetes suppresses liveness/readiness handling for slow-starting apps.Typical behavior:
livenessProbe to detect deadlocks/hung processes.readinessProbe to gate traffic until dependencies/init work are done.startupProbe when startup is slow and you don’t want liveness to kill the app too early.Simple mental model:
Summary of rednafi.com/go/test-config-with-flags.
The article compares three ways to toggle tests in Go (snapshot, integration, real-vs-mock) and argues for custom flags.
//go:build snapshotSummary of lorentz.app: go-shebang by Lorentz Kinde (2025-12).
Prepend this line to a .go file, chmod +x, then run it directly:
//usr/local/go/bin/go run "$0" "$@"; exitThe primary goal of documentation is to reduce friction for the reader. While the best starting point is simply ensuring a README.md exists, adhering to the following pillars will significantly improve the quality and longevity of your technical writing.
| // This code demonstrates how you can embed a type, | |
| // and have it satisfy an interface (`ProblemDetailer`) | |
| // but only for the embedded type. | |
| // This works because the interface uses an unexported method, | |
| // that is part of the embedded type's package. | |
| // https://go.dev/play/p/7lbikIyPHi1 | |
| // | |
| // IMPORTANT: If the `isProblem` inteface method was exported (i.e `IsProblem`), | |
| // then our `Fake` struct would pass the `.(errorsx.ProblemDetailer)` type assertion | |
| // e.g. https://go.dev/play/p/pPD3OgtiyHx |