listutil

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllOfList

func AllOfList[T any](l *list.List) []T

AllOfList returns all elements of the given list as a slice of type T.

The caller must ensure that every element stored in the list is of type T. If an element has a different type, this function will panic at runtime.

If the list is nil or empty, an empty slice is returned.

func ListOf

func ListOf[T any](items ...T) *list.List

ListOf creates a new list.List and populates it with the provided items.

All elements are inserted in the order they appear in the argument list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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