expr

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValue

func GetValue(v interface{}, expr string, opts ...Option) (value interface{}, found bool, err error)

GetValue finds a value in a map/struct/slice, returns the value and true if the value was found

func MustGetValue

func MustGetValue(v interface{}, expr string, opts ...Option) interface{}

MustGetValue finds a value in a map/struct/slice. It panics if an error occurred or the value was not found

Types

type Option

type Option uint8

Option is the type that will be used for Options

const (
	// IgnoreCase can be used to turn of case sensitivity
	IgnoreCase Option = iota
	// IgnoreNotFound ignores not found values and return nil (only MustGetValue)
	IgnoreNotFound
	// IgnoreError ignores errors and return nil (only MustGetValue)
	IgnoreError
)

Jump to

Keyboard shortcuts

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