Back to godoc.org

Package utils

v0.0.0-...-689a9a2
Latest Go to latest

The latest major version is .

Published: Jan 15, 2020 | License: Apache-2.0 | Module: bitbucket.org/intevation/kugelblitz

Index

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.

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier