goutil

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AstFileFilename

func AstFileFilename(astFile *ast.File, fset *token.FileSet) (string, error)

func FindGoMod

func FindGoMod(dir string) (string, bool)

func FindGoSum added in v1.3.1

func FindGoSum(dir string) (string, bool)

func FullEnv added in v1.3.1

func FullEnv() []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() ([]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 JoinPathLists

func JoinPathLists(w ...string) string

func ParseDirGoMod added in v1.1.0

func ParseDirGoMod(dir string) (*modfile.File, string, 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 ...interface{})

func ReadGoMod

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

func ReadSource

func ReadSource(filename string, src interface{}) ([]byte, error)

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

func SourceCursor

func SourceCursor(cursorStr, src string, n int) (string, int, error)

Allows a src string to have multiple cursor strings to simulate cursor position. Used in testing. Useful cursor runes: "●". First n position is zero.

func StartCPUProfile added in v1.1.0

func StartCPUProfile() error

func StopCPUProfile added in v1.1.0

func StopCPUProfile() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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