Skip to content

Repository files navigation

Tests Lint Security gitleaks Coverage

Basic Utils

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.

Minimum Go Version Requirement

To use or contribute to this project, install Go 1.26.4 or newer.

Modules

  • 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.

Installation

Make sure you have Go installed on your machine. Then, use go get to install the package:

go get github.com/kordax/basic-utils/v3@latest

Usage

You 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 github.com/kordax/basic-utils/v3/uqueue@latest

then...

import "github.com/kordax/basic-utils/v3/uqueue"

Then, refer to the individual documentation or code comments of each module for specific usage patterns.

Static Analysis

The repository uses GitHub Actions for tests, linting, coverage, vulnerability checks, security scanning, and secret scanning. The same checks can be run locally with Task:

task verify

Useful focused checks are also available: task test, task check, task check-coverage, task security, and task actionlint.

About

Go programming language helper utilities and syntax sugar

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages