Documentation
¶
Overview ¶
Copyright 2026 Teradata
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package slice provides slice utilities (stub for github.com/charmbracelet/x/exp/slice).
Index ¶
- func Chunk[T any](s []T, size int) [][]T
- func Contains[T comparable](s []T, v T) bool
- func Filter[T any](s []T, fn func(T) bool) []T
- func Find[T any](s []T, fn func(T) bool) (T, bool)
- func First[T any](s []T) (T, bool)
- func Flatten[T any](s [][]T) []T
- func Intersperse[T any](s []T, sep T) []T
- func Last[T any](s []T) (T, bool)
- func Map[T, U any](s []T, fn func(T) U) []U
- func Reverse[T any](s []T) []T
- func Unique[T comparable](s []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](s []T, v T) bool
Contains checks if slice contains element.
func Intersperse ¶
func Intersperse[T any](s []T, sep T) []T
Intersperse inserts sep between each element.
Types ¶
This section is empty.