first

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 0 Imported by: 9

README

first

The "coalesce" helper: first.String(...), first.Int(...), and first.Int64(...) each return the first non-zero/non-empty value from their variadic arguments, or the type's zero value if every argument is empty. Part of rosetta.

GoDoc

Useful for fallback chains — first.String(userValue, configValue, defaultValue). There's nothing subtle here; it's three short loops.

Documentation

Overview

Package first provides utility functions to return the first non-empty value from a list of values

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int

func Int(values ...int) int

Int returns the first non-zero value in the argument list

func Int64

func Int64(values ...int64) int64

Int64 returns the first non-zero value in the argument list

func String

func String(values ...string) string

String returns the first non-empty value 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