This section is empty.


This section is empty.


func Address

func Address(network, host string) string

Address constructs a URL from the given network and hostname.

func AddressUnspecifiedLess

func AddressUnspecifiedLess(a, b net.Addr) bool

AddressUnspecifiedLess is a comparator function preferring least specific network address (most widely listening, namely preferring over some IP), if both IPs are equal, it prefers the less restrictive network (prefers tcp over tcp4)

func CallWithContext

func CallWithContext(ctx context.Context, fn func() error) error

func CopyMatchingTag

func CopyMatchingTag(from interface{}, to interface{}, tag string, shouldCopy func(value string) bool)

CopyMatchingTag copies fields tagged tag:"value" from "from" struct onto "to" struct.

func FillNil

func FillNil(data interface{})

func FillNilExceptDeprecated

func FillNilExceptDeprecated(data interface{})

func FillNilSlices

func FillNilSlices(data interface{}) error

FillNilSlices sets default value on slices that are still nil.

func NiceDurationString

func NiceDurationString(d time.Duration) string

func SetDefaults

func SetDefaults(data interface{})

SetDefaults sets default values on a struct, based on the default annotation.

func UniqueTrimmedStrings

func UniqueTrimmedStrings(ss []string) []string

UniqueTrimmedStrings returns a list of all unique strings in ss, in the order in which they first appear in ss, after trimming away leading and trailing spaces.


This section is empty.

Source Files