gslice

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Of

func Of[T any](v ...T) []T

Of creates a slice from variadic arguments. If no argument given, an empty (non-nil) slice []T{} is returned.

💡 HINT: This function is used to omit verbose types like "[]LooooongTypeName{}" when constructing slices.

🚀 EXAMPLE:

Of(1, 2, 3) ⏩ []int{1, 2, 3}
Of(1)       ⏩ []int{1}
Of[int]()   ⏩ []int{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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