common

package module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 0 Imported by: 0

README

Common Utilities for Go

Welcome to the common library by go-softwarelab! This library is designed to simplify your Go development experience by providing a set of common tools and utilities. Our goal is to turn complexity into clarity, making your everyday coding tasks easier and more efficient.

One of the standout features of this library is its powerful set of functions that enhance the usability of Go iterators (iter.Seq and iter.Seq2). These functions are designed to make working with sequences in Go as seamless and pleasant as possible.

Documentation

For detailed documentation and examples, please visit Go Common Utils page.

We hope you find the common library useful and that it helps you write Go code that's as clear as a summer sky!

Installation

To install the common library, simply run:

go get github.com/go-softwarelab/common

Basic Example

Here's a basic example demonstrating how to use some of the key features of the common library:

package main

import (
	"fmt"

	"github.com/go-softwarelab/common/pkg/seq"
)

func main() {
	// Create a sequence of integers
	numbers := seq.Of(1, 2, 3, 4, 5, 6)

	// Filter the sequence to include only even numbers
	evenNumbers := seq.Filter(numbers, func(n int) bool {
		return n%2 == 0
	})

	// Map the filtered sequence to their squares
	squaredEvenNumbers := seq.Map(evenNumbers, func(n int) int {
		return n * n
	})

	// Print the result
	seq.ForEach(squaredEvenNumbers, func(i int) {
        fmt.Println(i)
	})
}

Documentation

Overview

Package common Utilities for Go

Welcome to the `common` library by `go-softwarelab`! This library is designed to simplify your Go development experience by providing a set of common tools and utilities. Our goal is to turn complexity into clarity, making your everyday coding tasks easier and more efficient.

One of the standout features of this library is its powerful set of functions that enhance the usability of Go iterators (`iter.Seq` and `iter.Seq2`). These functions are designed to make working with sequences in Go as seamless and pleasant as possible.

## Installation

To install the `common` library, simply run:

```sh go get github.com/go-softwarelab/common ``` ## Documentation

For more detailed documentation and examples, please visit [Go Common Utils](https://go-softwarelab.github.io/common) page.

We hope you find the `common` library useful and that it helps you write Go code that's as clear as a summer sky!

Directories

Path Synopsis
pkg
is
Package is provides a comprehensive set of predicates and validation functions for common conditional checks in Go applications.
Package is provides a comprehensive set of predicates and validation functions for common conditional checks in Go applications.
must
Package must provides a collection of utility functions that panic in error scenarios instead of returning errors, simplifying code in specific contexts.
Package must provides a collection of utility functions that panic in error scenarios instead of returning errors, simplifying code in specific contexts.
seq
Package seq provides a comprehensive set of utilities for working with sequences in Go applications.
Package seq provides a comprehensive set of utilities for working with sequences in Go applications.
seq2
Package seq2 provides a comprehensive set of utilities for working with key-value sequences in Go applications.
Package seq2 provides a comprehensive set of utilities for working with key-value sequences in Go applications.
seqerr
Package seqerr provides specialized utilities for handling errors when working with iter.Seq in Go applications.
Package seqerr provides specialized utilities for handling errors when working with iter.Seq in Go applications.
slices
Package slices provides a comprehensive set of utilities for working with slices in Go applications.
Package slices provides a comprehensive set of utilities for working with slices in Go applications.
slogx
Package slogx provides utility functions and helpers to complement the Go slog package.
Package slogx provides utility functions and helpers to complement the Go slog package.
testingx
Package testingx provides set of utilities for tests and runnable examples.
Package testingx provides set of utilities for tests and runnable examples.
to
Package to provides a comprehensive set of utility functions for type conversion and transformation in Go applications.
Package to provides a comprehensive set of utility functions for type conversion and transformation in Go applications.
types
Package types defines a set of useful constraints to be used with type parameters.
Package types defines a set of useful constraints to be used with type parameters.
x
Package x provides a set of utility functions, which are in experimental phase.
Package x provides a set of utility functions, which are in experimental phase.

Jump to

Keyboard shortcuts

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