fmsg

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package fmsg provides various functions for output messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsBaseError

func AsBaseError(err error, target **BaseError) bool

func Exit

func Exit(code int)

func Fatal

func Fatal(v ...any)

func Fatalf

func Fatalf(format string, v ...any)

func Print

func Print(v ...any)

func Printf

func Printf(format string, v ...any)

func Println

func Println(v ...any)

func Resume

func Resume()

func SetPrefix

func SetPrefix(prefix string)

func SetVerbose

func SetVerbose(v bool)

func Suspend

func Suspend()

func VPrintf

func VPrintf(format string, v ...any)

func VPrintln

func VPrintln(v ...any)

func Verbose

func Verbose() bool

func WrapError

func WrapError(err error, a ...any) error

WrapError wraps an error with a corresponding message.

func WrapErrorFunc

func WrapErrorFunc(err error, f func(err error) string) error

WrapErrorFunc wraps an error with a corresponding message returned by f.

func WrapErrorSuffix

func WrapErrorSuffix(err error, a ...any) error

WrapErrorSuffix wraps an error with a corresponding message with err at the end of the message.

Types

type BaseError

type BaseError struct {
	// contains filtered or unexported fields
}

BaseError implements an error container with a user-facing message

func (*BaseError) Error

func (e *BaseError) Error() string

func (*BaseError) Message

func (e *BaseError) Message() string

Message returns a user-facing error message

func (*BaseError) Unwrap

func (e *BaseError) Unwrap() error

Jump to

Keyboard shortcuts

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