common

package
v2.8.9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package common provides common utility functions for error handling, formatting, and multi-error management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(maybeError ...error) error

Combine combines multiple errors into a single error, filtering out nil errors.

func FormatTraffic

func FormatTraffic(trafficBytes int64) string

FormatTraffic formats traffic bytes into human-readable units (B, KB, MB, GB, TB, PB).

func NewError

func NewError(a ...any) error

NewError creates a new error from the given arguments.

func NewErrorf

func NewErrorf(format string, a ...any) error

NewErrorf creates a new error with formatted message.

func Recover

func Recover(msg string) any

Recover handles panic recovery and logs the panic error if a message is provided.

Types

This section is empty.

Jump to

Keyboard shortcuts

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