Lancet collects hundreds of reusable Go helpers for strings, slices, time, networking, cryptography, and data structures.
Overview
Lancet mirrors the scope of Apache Commons-style utilities for Go, inspired by lodash conventions. Packages are organized by domain so imports stay focused, such as strutil for strings or datetime for time helpers.
The v2 line rewrites APIs with Go 1.18 generics, while v1 remains for older compilers. The module depends only on the standard library and golang.org/x extensions.
Exported functions ship with unit tests documented on the project site. Coverage spans algorithms, concurrency helpers, conversion, validation, streams, retries, and file utilities suitable for application or service code.
Install through go get on the major version matching your Go toolchain, then import the specific package needed for each task.
Key features
- 700 plus utility functions
- Generics-based v2 APIs
- String slice and map helpers
- Datetime and crypto packages
- Concurrency and stream utilities
- Documented unit tests
- Minimal third-party deps
Use cases
- Shared helpers in Go services
- Reducing bespoke slice utilities
- Validation and conversion chores
- Algorithm and search snippets