⬆️ version bump to v4.5

- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5"
- Update version.txt from 4.29 → .30
(automated by Makefile)
This commit is contained in:
Eric Coissac
2026-04-07 08:36:50 +02:00
parent 670edc1958
commit 8c7017a99d
392 changed files with 18875 additions and 141 deletions
+22
View File
@@ -0,0 +1,22 @@
# `obiutils` Package Overview
The `obiutils` package provides generic, reusable utility functions for common slice operations in Go.
- **`Contains[T comparable](arr []T, x T) bool`**
Checks whether a given element exists in the slice. Uses generic type `T`, requiring only that it supports equality comparison.
- **`LookFor[T comparable](arr []T, x T) int`**
Returns the index of the *first* occurrence of `x`, or `-1` if not found. Also generic over comparable types.
- **`RemoveIndex[T comparable](s []T, index int) []T`**
Removes the element at `index`, returning a new slice. Works in O(1) time (amortized), using `append` to rebuild the slice.
- **`Reverse[S ~[]E, E any](s S, inplace bool) S`**
Reverses the slice elements. If `inplace = true`, modifies the original; otherwise, copies first and returns a reversed copy. Uses type constraint `~[]E` for flexibility across slice aliases.
All functions are designed to be:
- Type-safe via Go generics (no reflection),
- Efficient and idiomatic,
- Well-documented with clear parameter/return semantics.
Ideal for use in data processing, validation logic, or general-purpose slice manipulation.