lib

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UpdateGoldenFile = flag.Bool("update", false, "Updates the golden files with expected response.")

UpdateGoldenFile sets the flag if updates golden files with expected response.

Functions

func CompareGoldenFile

func CompareGoldenFile(t *testing.T, goldenFilePath string, actual []byte)

CompareGoldenFile compares or updates golden file contents with given bytes. For JSON content it will assert object equality if the string check fails

func DiffStrings

func DiffStrings(t *testing.T, exp, actual string)

DiffStrings output detailed diff between two strings.

Types

type SortMetricsByNameAndTags

type SortMetricsByNameAndTags []*m3.Metric

SortMetricsByNameAndTags ...

func (SortMetricsByNameAndTags) Len

func (a SortMetricsByNameAndTags) Len() int

Len ...

func (SortMetricsByNameAndTags) Less

func (a SortMetricsByNameAndTags) Less(i, j int) bool

Less ...

func (SortMetricsByNameAndTags) Swap

func (a SortMetricsByNameAndTags) Swap(i, j int)

Swap ...

type WaitAtLeast

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

WaitAtLeast wait group signals the wait channel when at least the added count are done. This avoids sync.WaitGroup panic when count is negative.

Usage:

wg := WaitAtLeast{}
wg.Add(1)
wg.Wait()
go func() {
    wg.Done()
}()

func (*WaitAtLeast) Add

func (w *WaitAtLeast) Add(count int)

Add positive wait count.

func (*WaitAtLeast) Done

func (w *WaitAtLeast) Done()

Done subtracts one from the wait count.

func (*WaitAtLeast) Wait

func (w *WaitAtLeast) Wait()

Wait for matching add/done.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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