Skip to content

kashifkhan0771/utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.23.3 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 Name Description Documentation Examples
boolean Utilities for boolean value checking and toggling README EXAMPLES
caching Cache management utilities README EXAMPLES
cryptoutils A set of cryptographic utility functions for various cryptographic operations README EXAMPLES
ctxutils Context utilities README EXAMPLES
errutils Error aggregation and management utilities README EXAMPLES
fake Fake data generation (UUIDs, addresses, dates) README EXAMPLES
fsutils File system utilities (size, metadata, comparison) README EXAMPLES
logging Flexible logging system for Golang README EXAMPLES
maps Utilities for state and metadata maps README EXAMPLES
math Mathematical utilities and helpers README EXAMPLES
pointers Helper functions for working with pointer values README EXAMPLES
rand Random number and string generation utilities README EXAMPLES
slice Slice manipulation and de-duplication utilities README EXAMPLES
slugger A simple and efficient way to generate URL-friendly slugs from strings README EXAMPLES
sort Sorting algorithms README EXAMPLES
stack Stack data structure README EXAMPLES
strings String manipulation and encoding utilities README EXAMPLES
structs Struct comparison utilities README EXAMPLES
templates Template rendering utilities README EXAMPLES
timeutils Time and date manipulation utilities README EXAMPLES
url URL parsing and manipulation utilities README EXAMPLES

Comparison

Feature / Utility Area kashifkhan0771/utils go-commons-lang gookit/goutil
Boolean Utilities βœ… Yes βœ… Yes βœ… Yes
Caching βœ… Yes ❌ No βœ… Yes
Cryptographic Utilities βœ… Yes βœ… Yes βœ… Yes
Context Utilities βœ… Yes ❌ No ❌ No
Error Aggregation βœ… Yes ❌ No βœ… Yes
Fake Data (UUID, etc.) βœ… Yes βœ… Yes βœ… Yes
Filesystem Utilities βœ… Yes βœ… Yes βœ… Yes
Logging βœ… Yes ❌ No βœ… Yes
Maps / Metadata Helpers βœ… Yes βœ… Yes βœ… Yes
Math Utilities βœ… Yes βœ… Yes βœ… Yes
Pointer Utilities βœ… Yes ❌ No ❌ No
Random Utilities βœ… Yes βœ… Yes βœ… Yes
Slice Utilities βœ… Yes βœ… Yes βœ… Yes
Slugify βœ… Yes ❌ No βœ… Yes
Sorting βœ… Yes βœ… Yes βœ… Yes
String Utilities βœ… Yes βœ… Yes βœ… Yes
Struct Comparison βœ… Yes ❌ No βœ… Yes
Template Helpers βœ… Yes ❌ No βœ… Yes
Time Utilities βœ… Yes βœ… Yes βœ… Yes
URL Utilities βœ… Yes ❌ No βœ… Yes
Dependency-Free βœ… Yes ❌ No ❌ No
Small API Surface βœ… Yes ❌ No βœ… Yes

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