generics

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 0 Imported by: 0

README

generics

Helper functions for working with Go generics

Documentation

Overview

Package generics contains helper functions for working with go generics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Zero

func Zero[T any]() T

Zero just provides a concise way to return the zero value of the instantiated value of a type parameter. Mostly useful when returning an error from a generic function or method. It doesn't do any magic, but is just convenient shorthand for declaring a variable of the parametric type, and returning that variable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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