osutil

package
v2.0.29 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Exit = func(t int, s string) {
	if s != "" {
		wPrintln(t, s)
	}
	if t >= 0 && !ArgTest() {
		os.Exit(t)
	}
}
View Source
var Panic = func(t int, s string) {
	panic(s)
}

Functions

func ArgTest

func ArgTest() bool

func CallerFn

func CallerFn(fn func(frame CallerFrame) bool, skip ...int) uintptr

func CallerFormatPath

func CallerFormatPath(path string, max ...int) string

func CallerPC

func CallerPC(skip ...int) uintptr

func CallerString

func CallerString(skip ...int) string

func DOT

func DOT() bool

DOT returns true if DEBUG is enabled or test mode is enabled.

func EnvDebug

func EnvDebug() bool

func ExeDir

func ExeDir() string

func ExeFull

func ExeFull() string

func ExeName

func ExeName() string

func ExitErr

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

func GoListRoot

func GoListRoot() string

func Must0 added in v2.0.6

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

func Must1 added in v2.0.6

func Must1[T any](v1 T, err error, a ...any) T

func Must2 added in v2.0.6

func Must2[T1 any, T2 any](v1 T1, v2 T2, err error, a ...any) (T1, T2)

func Must3 added in v2.0.6

func Must3[T1 any, T2 any, T3 any](v1 T1, v2 T2, v3 T3, err error, a ...any) (T1, T2, T3)

func PanicErr

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

func RunErr

func RunErr(fn func(t int, s string), err error, a ...any)

func Stack

func Stack(skip ...int) string

func WorkDir

func WorkDir() string

Types

type CallerFrame

type CallerFrame = runtime.Frame

type GoList added in v2.0.2

type GoList struct {
	Dir        string `json:"Dir"`
	ImportPath string `json:"ImportPath"`
	Name       string `json:"Name"`
	Root       string `json:"Root"`
	Module     struct {
		Path      string `json:"Path"`
		Main      bool   `json:"Main"`
		Dir       string `json:"Dir"`
		GoMod     string `json:"GoMod"`
		GoVersion string `json:"GoVersion"`
	} `json:"Module"`
}

func GetGoList added in v2.0.2

func GetGoList() GoList

Jump to

Keyboard shortcuts

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