Utils

May 13, 2026 · View on GitHub

Utils

A common utilities library for Go.

Overview

Utils is a lightweight, flexible, and reusable library that provides utility functions and helpers for common operations in Go applications. It includes packages for boolean conversions, context value handling, map operations, slice utilities, string manipulations, struct comparisons, and more—enhancing Go projects with optimized, clean, and practical solutions.

Prerequisites

  • Go: The project is written in Golang. Ensure you have Go installed (preferably Go 1.24 or later). You can download it here.
  • Git: Required for cloning the repository.

Installation

To use Utils in your project, add it as a module dependency:

Install the Package

go get github.com/kashifkhan0771/utils

Alternatively, include it directly in your go.mod file (use the latest release):

require github.com/kashifkhan0771/utils v0.3.0

Clone the Repository (For Development)

If you want to contribute or modify the library, clone the repository:

git clone https://github.com/kashifkhan0771/utils.git
cd utils

Key Features

Utility Packages

Package NameDescriptionDocumentationExamples
booleanUtilities for boolean value checking and togglingREADMEEXAMPLES
browserUtilities to open URLs in the default web browserREADMEEXAMPLES
cachingCache management utilitiesREADMEEXAMPLES
conversionConversion of data types, time, and temperaturesREADMEEXAMPLES
cryptoutilsA set of cryptographic utility functions for various cryptographic operationsREADMEEXAMPLES
ctxutilsContext utilitiesREADMEEXAMPLES
errutilsError aggregation and management utilitiesREADMEEXAMPLES
fakeFake data generation (UUIDs, addresses, dates)READMEEXAMPLES
fsutilsFile system utilities (size, metadata, comparison)READMEEXAMPLES
imageUtility functions for working with imagesREADMEEXAMPLES
loggingFlexible logging system for GolangREADMEEXAMPLES
mapsUtilities for state and metadata mapsREADMEEXAMPLES
mathMathematical utilities and helpersREADMEEXAMPLES
pdfPDF utilities (HTML to PDF, text extraction, merge, split)READMEEXAMPLES
pointersHelper functions for working with pointer valuesREADMEEXAMPLES
queueQueue data structureREADMEEXAMPLES
randRandom number and string generation utilitiesREADMEEXAMPLES
ratelimiterToken-bucket rate limiter (allow/wait, adjustable capacity & refill rate)READMEEXAMPLES
regexamplesGenerate random strings that match a given regular expressionREADMEEXAMPLES
sliceSlice manipulation and de-duplication utilitiesREADMEEXAMPLES
sluggerA simple and efficient way to generate URL-friendly slugs from stringsREADMEEXAMPLES
sortSorting algorithmsREADMEEXAMPLES
stackStack data structureREADMEEXAMPLES
stringsString manipulation and encoding utilitiesREADMEEXAMPLES
structsStruct comparison utilitiesREADMEEXAMPLES
templatesTemplate rendering utilitiesREADMEEXAMPLES
timeutilsTime and date manipulation utilitiesREADMEEXAMPLES
urlURL parsing and manipulation utilitiesREADMEEXAMPLES
retryRetry fallible operationsREADMEEXAMPLES

Contributions

Contributions are welcome! If you'd like to contribute, feel free to open a pull request.

Before submitting a PR, please review the Contribution Guide.

Together, we can make Utils even better for the Go community!

Credits

The image used in this project was sourced from https://github.com/MariaLetta/free-gophers-pack.

📷 Image by MariaLetta, used under the Creative Commons (CC0-1.0) license.

Contributors

Powered by coffee, code, and these legends ☕💻:

Star History

Star History Chart