slices

package
v2.2.6 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 0 Imported by: 0

README

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](slice []T, value 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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