utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitWithErr

func ExitWithErr(err error)

ExitWithErr exits with OS exit code that matches the exit code of the error

func ExtractUnknownArgs

func ExtractUnknownArgs(flags *pflag.FlagSet, args []string) []string

ExtractUnknownArgs extracts unknown args from a flagset https://github.com/spf13/cobra/issues/739#issuecomment-677999676

func NewDirEntry

func NewDirEntry(name string, isDir bool) fs.DirEntry

NewDirEntry DirEntry constructor

func WaitForConfirmation

func WaitForConfirmation(message string) bool

WaitForConfirmation waits for user confirmation (y/n)

Types

type DirEntry

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

DirEntry represents a directory entry (fs.DirEntry)

func (DirEntry) Info

func (d DirEntry) Info() (fs.FileInfo, error)

Info overrides fs.DirEntry.Info

func (DirEntry) IsDir

func (d DirEntry) IsDir() bool

IsDir overrides fs.DirEntry.IsDir

func (DirEntry) Name

func (d DirEntry) Name() string

Name overrides fs.DirEntry.Name

func (DirEntry) Type

func (d DirEntry) Type() fs.FileMode

Type overrides fs.DirEntry.Type

Jump to

Keyboard shortcuts

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