safeclose

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package safeclose provides a helper to safely close resources with error logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(name string, c interface{ Close() error })

Log closes c and writes a warning to stderr on error. name identifies the resource in the log message. Use for deferred Close() calls where the error is not actionable (best-effort cleanup).

func LogSimple

func LogSimple(name string, c interface{ Close() })

LogSimple is like Log but for types whose Close method returns nothing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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