gotils

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 3 Imported by: 2

README

codecov Go Report Card

Gotils

Golang utilities for building applications.

Why?

I found myself implementing almost the same utility functions in my new Go projects and it started to annoyed me.

I know there are a lot of other mature and good quality packages out there, but for me, who started using Go not long ago, it was a good exercise to implement these lightweight helpers.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateTimeFromString

func DateTimeFromString(dateTimeStr string) (*time.Time, error)

func Must added in v0.2.0

func Must[T any](res T, err error) T

func MustDateTimeFromString added in v0.2.0

func MustDateTimeFromString(dateTimeStr string) *time.Time

func NewGoroGroup

func NewGoroGroup() *goroGroup

func NewTimeout

func NewTimeout(duration time.Duration) (cancel func(), errorChannel <-chan error)

func NoErr added in v0.2.0

func NoErr(err error)

func Pointer

func Pointer[T any](value T) *T

func Reduce added in v0.1.2

func Reduce[T any](arr []T, f reduceFunc[T]) T

func ReduceSeq added in v0.2.0

func ReduceSeq[T any](seq iter.Seq[T], f reduceFunc[T]) T

Types

type Error

type Error string
const ErrorTimeout Error = "TIMEOUT_ERROR"

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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