https://github.com/kazhuravlev/just
Collection of useful functions. Complete simple tasks faster!
https://github.com/kazhuravlev/just
common essential go go-lib golang helpers lib
Last synced: 6 months ago
JSON representation
Collection of useful functions. Complete simple tasks faster!
- Host: GitHub
- URL: https://github.com/kazhuravlev/just
- Owner: kazhuravlev
- License: mit
- Created: 2022-08-11T15:49:24.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T19:00:19.000Z (about 1 year ago)
- Last Synced: 2025-04-01T16:16:18.656Z (6 months ago)
- Topics: common, essential, go, go-lib, golang, helpers, lib
- Language: Go
- Homepage:
- Size: 116 KB
- Stars: 32
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - kazhuravlev/just
- awesome-go - kazhuravlev/just
README
# just
[](https://pkg.go.dev/github.com/kazhuravlev/just)
[](https://github.com/kazhuravlev/just/blob/master/LICENSE)
[](https://github.com/kazhuravlev/just/actions/workflows/tests.yml?query=branch%3Amaster)
[](https://goreportcard.com/report/github.com/kazhuravlev/just)
[](https://codecov.io/gh/kazhuravlev/just)
[](https://github.com/avelino/awesome-go#utilities)This project contains features that help make the noisy stuff in every project.
- Filter slices, maps.
- Applying functions to collections.
- Null[any] for optional fields in API and sql.DB queries.## Most helpful functions
- [`SliceIter`](https://pkg.go.dev/github.com/kazhuravlev/just#SliceIter) allows you to iterate over slice with
special `IterContext` that provide some methods like `IsFirst`, `IsLast`
- [`SliceMap`](https://pkg.go.dev/github.com/kazhuravlev/just#SliceMap) and
[`SliceMapErr`](https://pkg.go.dev/github.com/kazhuravlev/just#SliceMapErr) allow you to map a slice to
another one. Useful for adapters.
- [`NewPool`](https://pkg.go.dev/github.com/kazhuravlev/just#NewPool) `sync.Pool` with generics
- [`ChanAdapt`](https://pkg.go.dev/github.com/kazhuravlev/just#ChanAdapt) allows to create an adapted version of channel
- [`ContextWithTimeout`](https://pkg.go.dev/github.com/kazhuravlev/just#ContextWithTimeout) runs a function with context
and timeout
- [`ErrAs`](https://pkg.go.dev/github.com/kazhuravlev/just#ErrAs) helps to handle an errors
- [`SliceChunk`](https://pkg.go.dev/github.com/kazhuravlev/just#SliceChunk) iterates over chunks
- [`SliceChain`](https://pkg.go.dev/github.com/kazhuravlev/just#SliceChain) joins slices to one
- [`StrSplitByChars`](https://pkg.go.dev/github.com/kazhuravlev/just#StrSplitByChars) splits the string by symbols## Examples
This library contains a bunch of functions. Please
see [pkg.go.dev](https://pkg.go.dev/github.com/kazhuravlev/just#pkg-examples)
for examples.