goutils/v2/slices
The slices
package is a collection of utility functions
designed to simplify common slices tasks.
Table of contents
Functions
Contains([]T, T)
Contains([]T, T) bool
Contains checks if a value is present in a slice.
Parameters:
slice: Slice to check for the value.
value: Value to check for in the slice.
Returns:
bool: true if the value is present in the slice, false otherwise.
Installation
To use the goutils/v2/slices package, you first need to install it.
Follow the steps below to install via go get.
go get github.com/l50/goutils/v2/slices
Usage
After installation, you can import the package in your Go project
using the following import statement:
import "github.com/l50/goutils/v2/slices"
Tests
To ensure the package is working correctly, run the following
command to execute the tests for goutils/v2/slices
:
go test -v
Contributing
Pull requests are welcome. For major changes,
please open an issue first to discuss what
you would like to change.
License
This project is licensed under the MIT
License - see the LICENSE
file for details.