This repository contains a collection of utility libraries implemented in Go, designed to assist in a variety of common programming tasks. Each module addresses a particular set of functions or data structures.
To use or contribute to this project, you need to have at least Go 1.27 installed. This is due to the usage of features and packages introduced in this version.
- uarray: Slice utilities for searching, filtering, mapping, grouping, set-like operations, safe indexing, chunking, and string conversion.
- uasync: Async execution helpers, futures, scheduled tasks, retry helpers, and grouped task execution.
- ucache: Cache implementations, TTL support, composite keys, multi-cache structures, and managed cleanup wrappers.
- ucast: Bi-directional utilities to convert basic types.
- uconst: Shared constraints and common generic contracts.
- uctx: Small context-related helpers.
- uerror: Error handling helpers.
- uevent: Channel watcher helpers.
- ufile: File-system helpers for common read/write/list workflows.
- umap: Map utilities and multi-map implementations.
- umath: Mathematical utilities and helpers.
- unumber: Versatile numeric representation and denomination helpers.
- uonce: Helpers for one-time execution semantics.
- uopt: Optional type implementation with JSON/SQL support and functional helpers.
- uos: Operating-system and environment variable helpers.
- upair: Pair type helpers.
- uqueue: FIFO, lock-free concurrent FIFO, and priority queues.
- uref: Reference helpers.
- uset: Set implementations and set algebra helpers.
- usql: SQL helper types and functions.
- usrlz: Serialization helpers.
- usize: Byte-sized data unit constants.
- ustr: String helpers.
- ustream: Experimental stream-style helpers for slice processing.
Make sure you have Go installed on your machine. Then, use go get to install the package:
go get -u github.com/kordax/basic-utils/v4You can import each module individually or import the main module and it depends on your needs. For example, to use the queue library:
go get -u github.com/kordax/basic-utils/v4/uqueuethen...
import "github.com/kordax/basic-utils/v4/uqueue"Then, refer to the individual documentation or code comments of each module for specific usage patterns.
The repository also includes a staticcheck.conf file, indicating that it might be set up to use the staticcheck tool for static code analysis. Run staticcheck in the root directory to perform a code quality check.