utils

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyString = ""

Variables

View Source
var (
	ProjectMultiLevelPath  = fmt.Sprint(testPath, "/projectMultiLevel")
	ProjectSimpleLevelPath = fmt.Sprint(testPath, "/projectSimpleLevel")
)

Functions

func All added in v0.2.0

func All(vs []string, f func(string) bool) bool

All returns `true` if every strings in the slice satisfy the predicate `f`.

func Any added in v0.2.0

func Any(vs []string, f func(string) bool) bool

Any returns `true` if one of the strings in the slice satisfies the predicate `f`.

func AppendPrefixOnSlice added in v0.2.0

func AppendPrefixOnSlice(prefix string, slice []string) (result []string)

func AppendSuffixOnSlice added in v0.2.0

func AppendSuffixOnSlice(suffix string, slice []string) (result []string)

func DeepEqual added in v0.2.0

func DeepEqual(t *testing.T, expected interface{}, actual interface{})

func Filter added in v0.2.0

func Filter(vs []string, f func(string) bool) []string

Filter returns a new slice containing all strings in the slice that satisfy the predicate `f`.

func Include added in v0.2.0

func Include(vs []string, t string) bool

Include returns `true` if the target string t is in the slice.

func Index added in v0.2.0

func Index(vs []string, t string) int

Index returns the first index of the target string `t`, or -1 if no match is found.

func Map added in v0.2.0

func Map(vs []string, f func(string) string) []string

Map returns a new slice containing the results of applying the function `f` to each string in the original slice.

func MapHasAllTrue added in v0.2.0

func MapHasAllTrue(a map[string]bool) bool

func NotDeepEqual added in v0.2.0

func NotDeepEqual(t *testing.T, expected interface{}, actual interface{})

func WrapGrey added in v0.2.0

func WrapGrey(msg ...string) string

func WrapRed added in v0.2.0

func WrapRed(msg ...string) string

func WrapYellow added in v0.2.0

func WrapYellow(msg ...string) string

Types

type Set added in v0.2.0

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

func NewSet

func NewSet() *Set

func NewSetFromSlice added in v0.2.0

func NewSetFromSlice(elements ...string) *Set

func (*Set) Add added in v0.2.0

func (s *Set) Add(value string) *Set

func (*Set) Concat added in v0.2.0

func (s *Set) Concat(values []string) *Set

func (*Set) Contains added in v0.2.0

func (s *Set) Contains(value string) bool

func (*Set) List added in v0.2.0

func (s *Set) List() (list []string)

Return a sorted list of values

func (*Set) Remove added in v0.2.0

func (s *Set) Remove(value string) *Set

func (*Set) UnmarshalYAML added in v0.2.0

func (s *Set) UnmarshalYAML(unmarshal func(i interface{}) error) (err error)

Read Struct Field to return the associated Tag name It's used to read string or slice of string due to different notation in yaml

Jump to

Keyboard shortcuts

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