geterrors

package
Version: v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 1, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package geterrors is used build a list of missing values to reduce error checking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrGetter

type ErrGetter struct {
	// contains filtered or unexported fields
}

ErrGetter has a get function and an array of missing keys for get calls.

func WrapFunc

func WrapFunc(get func(string) string) ErrGetter

WrapFunc takes a function for getting values.

Returns an ErrGetter.

func (*ErrGetter) Err

func (g *ErrGetter) Err(message string) error

Err takes a message.

Returns an error string prepended with a message and a list of the missing keys.

func (*ErrGetter) Get

func (g *ErrGetter) Get(key string) string

Get takes a key value and uses the function from the WrapFunc method. If the key is missing it makes a slice of missing keys.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL