stdlo

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 2 Imported by: 3

Documentation

Overview

Package stdlo provides a minimal version of the lo project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map[T any, R any](collection []T, iteratee func(item T, index int) R) []R

Map manipulates a slice and transforms it to a slice of another type. Play: https://go.dev/play/p/OkPcYAhBo0D

func Must0

func Must0(err any, messageArgs ...any)

Must0 has the same behavior as Must, but callback returns no variable. Play: https://go.dev/play/p/TMoWrRp3DyC

func Must1

func Must1[T any](val T, err any, messageArgs ...any) T

Must1 is an alias to Must Play: https://go.dev/play/p/TMoWrRp3DyC

func Must2

func Must2[T1, T2 any](val1 T1, val2 T2, err any, messageArgs ...any) (T1, T2)

Must2 has the same behavior as Must, but callback returns 2 variables. Play: https://go.dev/play/p/TMoWrRp3DyC

func Must3

func Must3[T1, T2, T3 any](val1 T1, val2 T2, val3 T3, err any, messageArgs ...any) (T1, T2, T3)

Must3 has the same behavior as Must, but callback returns 3 variables. Play: https://go.dev/play/p/TMoWrRp3DyC

func Must4

func Must4[T1, T2, T3, T4 any](val1 T1, val2 T2, val3 T3, val4 T4, err any, messageArgs ...any) (T1, T2, T3, T4)

Must4 has the same behavior as Must, but callback returns 4 variables. Play: https://go.dev/play/p/TMoWrRp3DyC

func Must5

func Must5[T1, T2, T3, T4, T5 any](val1 T1, val2 T2, val3 T3, val4 T4, val5 T5, err any, messageArgs ...any) (T1, T2, T3, T4, T5)

Must5 has the same behavior as Must, but callback returns 5 variables. Play: https://go.dev/play/p/TMoWrRp3DyC

func Must6

func Must6[T1, T2, T3, T4, T5, T6 any](val1 T1, val2 T2, val3 T3, val4 T4, val5 T5, val6 T6, err any, messageArgs ...any) (T1, T2, T3, T4, T5, T6)

Must6 has the same behavior as Must, but callback returns 6 variables. Play: https://go.dev/play/p/TMoWrRp3DyC

func ToPtr

func ToPtr[T any](x T) *T

ToPtr returns a pointer copy of value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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