util

package
v0.4.26 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAll added in v0.4.21

func CloseAll(closers ...io.Closer) error

CloseAll calls Close() on every closer, returning the err from the first one that returns a non-nil error.

func Git

func Git(arg ...string) (string, error)

func Must added in v0.4.22

func Must(err error)

Must panics if err is non-nil

func PropagateCloseError added in v0.4.21

func PropagateCloseError(closer io.Closer, f func() error) (err error)

PropagateCloseError calls f then calls closer.Close(), returning the error from Close() if f did not return an error. Errors from Close() when writing can return important errors that should not be thrown away.

func StringSliceContains

func StringSliceContains(s []string, t string) bool

Types

type StringSet added in v0.4.7

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

func NewStringSet added in v0.4.7

func NewStringSet() *StringSet

func NewStringSetWithValues added in v0.4.15

func NewStringSetWithValues(values []string) *StringSet

func (*StringSet) Add added in v0.4.7

func (ss *StringSet) Add(s string) bool

Adds s to the set and returns true if the string wasn't already present

func (*StringSet) AddAll added in v0.4.7

func (ss *StringSet) AddAll(values ...string) *StringSet

func (*StringSet) Contains added in v0.4.7

func (ss *StringSet) Contains(s string) bool

func (*StringSet) Values added in v0.4.7

func (ss *StringSet) Values() []string

Jump to

Keyboard shortcuts

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