util

package
v0.0.0-...-4b81338 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flag

func Flag[T flag.Value](name string, value T, usage string) T

func Last

func Last[T any](s ...[]T) (v T, ok bool)

Last returns the last element from the provided slices. In other words, if it is passed two slices and the second is empty, it will return the last item of the first. ok is only false if all of the provided slices are empty or no slices were provided.

func Match

func Match[T any](v T) func(T) bool

Match returns a function that returns true if passed v. T must be a comparable type or the returned function will panic. T may be an interface type.

func StringsFlag

func StringsFlag(name string, value []string, usage string) *[]string

Types

This section is empty.

Jump to

Keyboard shortcuts

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