utils

package
v0.0.0-...-689a9a2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpJSON

func DumpJSON(data interface{})

DumpJSON dumps a pretty printed JSON representation of the given data to stdout.

func Env

func Env(key, def string) string

Env looks up a value for environment variable and returns it. If not found it returns the given default value.

func Trace

func Trace(d int) string

Trace generates a string containing the current execution position on the call stack consisting of the function name and the line number. d = 0 is inside the Trace function itself, d = 1 the caller of Trace and d = 2 the caller of the caller and so on.

Types

type BoolErrList

type BoolErrList []be

BoolErrList piles up a tuples of success values and errors.

func (*BoolErrList) Append

func (l *BoolErrList) Append(b bool, e error)

Append adds a tuple of a success value and an error to the list.

func (BoolErrList) Reduce

func (l BoolErrList) Reduce() (bool, error)

Reduce returns the first error in the list. If there is no error it returns if there is a no-sucess value.

Jump to

Keyboard shortcuts

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