resolver

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindValue

func BindValue(val reflect.Value, value string) error

BindValue binds a string value to a reflect.Value.

Example:

var x int
err := resolver.BindValue(reflect.ValueOf(&x).Elem(), "42")

func GetValue

func GetValue(cliVal *string, envName, defVal string, isFlag bool) (string, error)

GetValue returns the value to bind based on priority: CLI > Env > Default.

Example:

val, err := resolver.GetValue(nil, "ENV_VAR", "default", false)

func ParseBool

func ParseBool(str string) (bool, error)

ParseBool parses a boolean string with support for more formats.

Example:

b, err := resolver.ParseBool("yes")

Types

This section is empty.

Jump to

Keyboard shortcuts

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