package
Version:
v0.1.21
Opens a new window with list of versions in this module.
Published: May 22, 2026
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Truncate[T any](items []T, n int) []T
Truncate returns a slice of the first n elements of the input slice.
If n is greater than the length of the input slice, the entire slice is returned.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.