closeutil

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package closeutil provides convenience methods to wrap closing process with logging on suppression of related errors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseOrLog

func CloseOrLog(
	ctx context.Context,
	logger *slog.Logger,
	closer io.Closer,
	resource string,
)

CloseOrLog is an util function that calls io.Closer.Close method on provided closer and logs the error with provided logger if Close fails.

func CloseOrSuppress

func CloseOrSuppress(c io.Closer)

CloseOrSuppress is an util function that calls io.Closer.Close method on provided closer and ignores the output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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