Overview
June 23, 2026 · View on GitHub
Overview
go-snk is the library you pull into any Go project to clean it up and keep it clean. The name is short for
kitchen sink — not because it does everything, but because it collects the small, type-safe helpers you
keep reaching for across projects.
In practice that means replacing repeated loops with named helpers, eliminating one-off utilities scattered across your codebase, and keeping everyday code easy to read through consistent patterns. Each package is intentionally narrow so you can adopt only what you need.
Packages
slicex
Helpers for slice operations such as filtering, mapping, reducing, grouping, deduplicating, partitioning, zipping, windowing, rotating, and basic numeric aggregation.
slicex/parallel
Helpers for parallel slice operations where each item can be processed independently and concurrency can improve throughput.
mapx
Helpers for common map operations such as extracting keys or values, filtering, partitioning, transforming keys, counting entries by a classifier, combining maps, and merging maps with conflict resolution.
httpx
Helpers for HTTP client code that reduce boilerplate and support typed response handling.
httpxtest
A builder for spinning up httptest servers in tests, with canned responses, per-route handlers, and response
shaping such as headers, cookies, and delays.
jsonx
Helpers for encoding and decoding JSON to and from common sources such as readers, byte slices, and strings, with consistent option handling.
conditional
Helpers for concise conditional expressions and callback-style branching.
stringx
Helpers for common string operations such as blank checks, fallback selection, truncation, wrapping, and padding.
errorx
Helpers for common error handling patterns such as intentional error suppression, initialization-time panics, and matching an error against multiple targets, and reducing a list of errors to the first non-nil result.
containers
Reusable collection types including lists, sets, stacks, and queues.
helpers
Generic utilities for working with pointers and zero values, including safe dereferencing with fallbacks, typed nil and zero value construction, and nil checks.
Design principles
The library aims to stay small and focused rather than grow into a full application framework. Most packages are intentionally narrow in scope so they can be adopted independently, and practical for everyday use rather than edge cases.