goutil

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerFileLine added in v1.3.7

func CallerFileLine(skip int) string

func CallerName added in v1.3.7

func CallerName(skip int) string

func FindGoMod

func FindGoMod(dir string) (string, bool)

func FindGoSum added in v1.3.1

func FindGoSum(dir string) (string, bool)

func FuncName added in v1.3.7

func FuncName(f any) string

func GetGoPath added in v1.3.1

func GetGoPath(env []string) []string

func GetGoRoot added in v1.3.1

func GetGoRoot(env []string) string

func GetGoVersion added in v1.3.1

func GetGoVersion(env []string) (string, error)

returns version as in "1.0" without the "go" prefix

func GoEnv added in v1.3.1

func GoEnv(dir string) []string

func GoEnv2 added in v1.3.3

func GoEnv2(dir string) ([]string, error)

func GoModExclude added in v1.3.1

func GoModExclude(ctx context.Context, dir, path string, env []string) error

func GoModInit added in v1.1.0

func GoModInit(ctx context.Context, dir, modPath string, env []string) error

func GoModReplace

func GoModReplace(ctx context.Context, dir, old, new string, env []string) error

func GoModRequire

func GoModRequire(ctx context.Context, dir, path string, env []string) error

func GoModTidy added in v1.1.0

func GoModTidy(ctx context.Context, dir string, env []string) error

func GoPath

func GoPath() []string

func GoRoot added in v1.3.1

func GoRoot() string

func GoVersion added in v1.3.1

func GoVersion() (string, error)

func Hashable added in v1.3.7

func Hashable(v any) bool

func JoinPathLists

func JoinPathLists(w ...string) string

func Log added in v1.3.7

func Log(args ...any)

func LogSkip added in v1.3.7

func LogSkip(skip int, args ...any)

func LogSkipf added in v1.3.7

func LogSkipf(skip int, f string, args ...any)

func Logf added in v1.3.7

func Logf(f string, args ...any)

func OsAndGoEnv added in v1.3.3

func OsAndGoEnv(dir string) []string

func ParseDirGoMod added in v1.1.0

func ParseDirGoMod(dir string) (*modfile.File, string, error)

func ParseFuncDecl added in v1.3.7

func ParseFuncDecl(name, src string) (*ast.FuncDecl, error)

func PrintAstFile added in v1.1.0

func PrintAstFile(w io.Writer, fset *token.FileSet, astFile *ast.File) error

func Printfc added in v1.3.0

func Printfc(skip int, f string, args ...any)

func ReadGoMod

func ReadGoMod(ctx context.Context, dir string, env []string) (*modfile.File, error)

func ReadSource

func ReadSource(filename string, src any) ([]byte, error)

taken from: go/parser/interface.go:25:9

func SprintFnStack added in v1.3.7

func SprintFnStack(skip int) string

func Sprintfc added in v1.3.7

func Sprintfc(skip int, f string, args ...any) string

func StartCPUProfile added in v1.1.0

func StartCPUProfile() error

func StopCPUProfile added in v1.1.0

func StopCPUProfile() error

func TodoError added in v1.3.7

func TodoError(args ...any) error

func TodoErrorSkip added in v1.3.7

func TodoErrorSkip(skip int, args ...any) error

func TodoErrorSkipf added in v1.3.7

func TodoErrorSkipf(skip int, f string, args ...any) error

func TodoErrorStr added in v1.3.7

func TodoErrorStr(s string) error

func TodoErrorType added in v1.3.7

func TodoErrorType(t any) error

func TodoErrorf added in v1.3.7

func TodoErrorf(f string, args ...any) error

func Trace added in v1.3.7

func Trace(n int) (string, int, string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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