cli

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModePatch = "patch"
	ModeFull  = "full" // Maybe later change to minor, major?
)
View Source
const (
	AppNPM = "npm"
	AppNPX = "npx"
)
View Source
const (
	AppGo = "go"
)

Variables

This section is empty.

Functions

func GoBuild

func GoBuild(opts GoBuildOptions) error

GoBuild compiles the specified main package into a binary.

func GoClean

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

func GoFixImports

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

func GoFmt

func GoFmt(ctx context.Context, fPath string) error

func GoModVer

func GoModVer() (string, error)

func GoRun

func GoRun(mainPath string) error

func GoTidy

func GoTidy(ctx context.Context, dir string) error

func GoVer

func GoVer() (string, error)

func GoVet

func GoVet(ctx context.Context, fPath string) error

func JsFmt

func JsFmt(ctx context.Context, dir, relPath string) error

JsFmt formats a JS/TS file relative to dir using prettier (npx or npm exec).

func Lookup

func Lookup(cmd string) bool

Lookup check if an app is available in CLI

func Shell

func Shell() string

func TsFmt

func TsFmt(ctx context.Context, dir, relPath string) error

TsFmt reuses the JS formatter via prettier.

Types

type GoBuildOptions

type GoBuildOptions struct {
	Dir         string
	MainPackage string
	Output      string
	GOOS        string
	GOARCH      string
}

type GoRunOptions

type GoRunOptions struct {
	Dir                 string
	MainPackage         string
	Args                []string
	Stdout              io.Writer
	Stderr              io.Writer
	Stdin               io.Reader
	DisableProcessGroup bool
}

type GoRunProcess

type GoRunProcess struct {
	Cmd    *exec.Cmd
	Output *bytes.Buffer
	Done   <-chan error
}

func StartGoRunProcess

func StartGoRunProcess(opts GoRunOptions) (*GoRunProcess, error)

type ModuleChange

type ModuleChange struct {
	Path       string
	OldVersion string
	NewVersion string
}

func GoUpdateWithChanges

func GoUpdateWithChanges(ctx context.Context, dir, mode string) ([]ModuleChange, error)

GoUpdateWithChanges updates the project dependencies and returns the changes mode: patch or else

Jump to

Keyboard shortcuts

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