utils

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(ctx context.Context, closer io.Closer)

Close closes the io.Closer interface. Logs failures with warning level and the given context on failure. Supposed usage as simple drop-in replacement for defer closer.Close() usage where errors could go unnoticed.

func Contains

func Contains[T comparable](list []T, val T) bool

Contains checks if the list slice contains the val.

func ContainsAfterSplit

func ContainsAfterSplit(list []string, splitter string, val string) bool

ContainsAfterSplit checks if the list string slice contains the val string after splitting each element along the splitter.

func Unzip

func Unzip(in []byte) ([]byte, error)

Unzip unzips the input byte slice.

func Zip

func Zip(in []byte, level int) ([]byte, error)

Zip zips the input byte slice with the given gzip compression level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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