util

package
v0.0.0-...-002f8de Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(msg string, args ...interface{})

func FileExist

func FileExist(file string) bool

func FindGoModFile

func FindGoModFile() (string, error)

func GetPkgName

func GetPkgName() (string, error)

func MkDir

func MkDir(dir string) error

func PipeOutput

func PipeOutput(cmd *exec.Cmd, pipe func(line []byte)) error

Types

type GoCmd

type GoCmd struct {
}

func (*GoCmd) Exec

func (g *GoCmd) Exec(args ...string) error

func (*GoCmd) ExecWithoutOutput

func (g *GoCmd) ExecWithoutOutput(args ...string) error

func (*GoCmd) Fmt

func (g *GoCmd) Fmt(paths ...string)

func (*GoCmd) FmtAll

func (g *GoCmd) FmtAll(dir ...string)

func (*GoCmd) Get

func (g *GoCmd) Get(pkg string)

func (*GoCmd) Install

func (g *GoCmd) Install(pkg string)

func (*GoCmd) List

func (g *GoCmd) List() (*GoList, error)

func (*GoCmd) ModInit

func (g *GoCmd) ModInit(pkg string)

func (*GoCmd) ModTidy

func (g *GoCmd) ModTidy()

func (*GoCmd) Run

func (g *GoCmd) Run(file string)

type GoList

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

Jump to

Keyboard shortcuts

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