utils

package
v0.0.0-...-2ae8eea Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountDigits

func CountDigits(i int) (count int)

CountDigits counts the digits of an integer

func LeftPad2Len

func LeftPad2Len(num, padNum, overallLen int) string

LeftPad2Len pads s with padStr to match overallLen

func Sleep

func Sleep(seconds int)

Sleep sleeps for an input number of seconds

func SplitInTwo

func SplitInTwo(s, sep string) (string, string)

SplitInTwo splits a string to two parts by a delimeter

func ToggleEnvVar

func ToggleEnvVar(key, value string) string

ToggleEnvVar sets key to a new value and returns its old value

Types

type BoundedWaitGroup

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

BoundedWaitGroup implements a sized WaitGroup

func NewBoundedWaitGroup

func NewBoundedWaitGroup(cap int) BoundedWaitGroup

NewBoundedWaitGroup initializes a new BoundedWaitGroup

func (*BoundedWaitGroup) Add

func (bwg *BoundedWaitGroup) Add(delta int)

Add performs a WaitGroup Add of a specified delta

func (*BoundedWaitGroup) Done

func (bwg *BoundedWaitGroup) Done()

Done performs a WaitGroup Add of -1

func (*BoundedWaitGroup) Wait

func (bwg *BoundedWaitGroup) Wait()

Wait performs a WaitGroup Wait

Jump to

Keyboard shortcuts

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