fmsg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 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 added in v0.0.8

func Exit(code int)

func Fatal added in v0.0.8

func Fatal(v ...any)

func Fatalf added in v0.0.8

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

func Print added in v0.0.8

func Print(v ...any)

func Printf added in v0.0.8

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

func Println added in v0.0.8

func Println(v ...any)

func Resume added in v0.0.8

func Resume()

func SetPrefix added in v0.0.8

func SetPrefix(prefix string)

func SetVerbose added in v0.0.8

func SetVerbose(v bool)

func VPrintf added in v0.0.8

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

func VPrintln added in v0.0.8

func VPrintln(v ...any)

func Verbose added in v0.0.8

func Verbose() bool

func Withhold added in v0.0.8

func Withhold()

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