util

package
v0.4.35 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 6 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 ExitCode added in v0.4.31

func ExitCode(err error) int

Returns the exit code from an error if the error is an exec.ExitError, or -1 if the err is non-nil, or 0 otherwise.

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 RemoveJNodeElementsIf added in v0.4.34

func RemoveJNodeElementsIf(n *jnode.Node, f func(*jnode.Node) bool) *jnode.Node

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) Get added in v0.4.30

func (ss *StringSet) Get(i int) string

func (*StringSet) Len added in v0.4.30

func (ss *StringSet) Len() int

func (*StringSet) MarshalJSON added in v0.4.30

func (ss *StringSet) MarshalJSON() ([]byte, error)

func (*StringSet) Reset added in v0.4.30

func (ss *StringSet) Reset()

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