pkg

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2026 License: MIT

README

Low-level Go packages I use across my own projects. Fast, and mostly dependency-free.

Go Reference Coverage Status Go Reference Coverage Status

package doc about
async go.dev Futures, promises, and deferred actions
syncx go.dev Synchronization primitives: reentrant mutex, semaphore, sync value, WithLock
chanx go.dev Channel helpers: fan-in, send/receive conversions
errx go.dev Error utilities: MultiError
structx go.dev Data structures: OrderedMap, ObjectPool
reflectx go.dev Reflection helpers: payload-size estimation

Install

go get github.com/lif0/pkg@latest
import (
    "github.com/lif0/pkg/async"
    "github.com/lif0/pkg/syncx"
    "github.com/lif0/pkg/chanx"
    "github.com/lif0/pkg/errx"
    "github.com/lif0/pkg/structx"
    "github.com/lif0/pkg/reflectx"
)

Migrating from the old multi-module layout? See CHANGELOG.md for the import-path mapping. Old tags (concurrency/v*, sync/v*, utils/v*) still resolve, so existing pins keep working.


Purpose

This repository provides a set of low-level, production-grade packages for Go — designed for maximum performance, zero allocations where possible, and clean, idiomatic APIs.

The goal is to build a unified, reusable toolkit that can be safely used across personal and production systems — with strong guarantees on code quality, stability, and efficiency.

All packages are:

  • Fully tested (95-100% coverage)
  • Benchmarked
  • API-stable and versioned (semver)
  • Maintained and supported
  • Free of any non-standard dependencies

Stability

This repository follows semantic versioning.
All exported APIs are stable, and breaking changes will be reflected in the major version.

Releases are tagged and versioned. You can safely pin versions for use in production.


Contribution Guidelines

Contributions are welcome!

To contribute a package, feature, or bugfix:

  • Coverage must be ≥95%
  • All code must be tested and benchmarked
  • Use of standard library imports is highly desirable and allowed; avoid external dependencies where possible
  • APIs should be minimal, idiomatic, and efficient
  • Follow Conventional Commits

To propose a new idea or package, please open an issue or discussion with:

  • Motivation and use case
  • Expected behavior and API shape
  • Edge cases and potential risks

License

MIT

Directories

Path Synopsis
Package async provides asynchronous orchestration primitives for Go: promises, futures, and deferred actions.
Package async provides asynchronous orchestration primitives for Go: promises, futures, and deferred actions.
Package chanx provides utilities for working with channels in Go, including type conversions and concurrency patterns.
Package chanx provides utilities for working with channels in Go, including type conversions and concurrency patterns.
concurrency module
Package errx provides small error-handling helpers, such as MultiError.
Package errx provides small error-handling helpers, such as MultiError.
Package internal holds shared helpers used across the pkg packages.
Package internal holds shared helpers used across the pkg packages.
Package reflectx provides reflection-based helpers that extend the standard library reflect package, such as estimating the in-memory payload of a value.
Package reflectx provides reflection-based helpers that extend the standard library reflect package, such as estimating the in-memory payload of a value.
semantic module
Package structx provides ordered and pooled data structures.
Package structx provides ordered and pooled data structures.
sync module
Package syncx provides synchronization utilities.
Package syncx provides synchronization utilities.
utils module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL