runutil

package
v0.0.0-...-c73f165 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseWithErrCapture

func CloseWithErrCapture(err *error, closer io.Closer, format string, a ...interface{})

CloseWithErrCapture closes closer and wraps any error with the provided message and assigns it to err.

func CloseWithLogOnErr

func CloseWithLogOnErr(logger log.Logger, closer io.Closer, format string, args ...interface{})

CloseWithLogOnErr closes an io.Closer and logs any relevant error from it wrapped with the provided format string and args.

func DeleteAll

func DeleteAll(dir string, ignoreDirs ...string) error

DeleteAll deletes all files and directories inside the given dir except for the ignoreDirs directories. NOTE: DeleteAll is not idempotent.

func ExhaustCloseWithErrCapture

func ExhaustCloseWithErrCapture(err *error, r io.ReadCloser, format string, a ...interface{})

ExhaustCloseWithErrCapture closes the io.ReadCloser with error capture but exhausts the reader before.

Types

This section is empty.

Jump to

Keyboard shortcuts

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