util

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAPipe = errors.New("this command should be run in a pipe")

Functions

func CmdsContains

func CmdsContains(cmds []*cobra.Command, target *cobra.Command) bool

func NewExitCodeError

func NewExitCodeError(code int) error

func Umask

func Umask(mask int) int

Types

type ExitCodeError

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

func (ExitCodeError) Error

func (e ExitCodeError) Error() string

func (ExitCodeError) ExitCode

func (e ExitCodeError) ExitCode() int

type SuppressErrorWriter

type SuppressErrorWriter struct {
	Error error
	// contains filtered or unexported fields
}

SuppressErrorWriter proxies writes to another writer. If a write returns an error, the error will be suppressed and the writer will be disabled.

func NewSuppressErrorWriter

func NewSuppressErrorWriter(w io.Writer) *SuppressErrorWriter

func (*SuppressErrorWriter) Close

func (w *SuppressErrorWriter) Close() error

func (*SuppressErrorWriter) Reset

func (w *SuppressErrorWriter) Reset()

func (*SuppressErrorWriter) Write

func (w *SuppressErrorWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳