gotool

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package gotool runs the go command on the developer's module. Every go subprocess of aicoded goes through it. It turns what go build, go vet and go test print into coded problems whose positions are relative to the module's folder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, dir string) ([]*errs.Error, error)

Build compiles every package of the module in dir and writes nothing into dir.

func BuildBinary

func BuildBinary(ctx context.Context, dir, out string) ([]*errs.Error, error)

BuildBinary compiles the main package in dir into the file out.

func Find

func Find() error

Find fails with E-CHK-005 when the go command is not on PATH.

func Race

func Race(ctx context.Context, dir string) (ok bool, why string, err error)

Race reports whether go test -race can run for the module in dir, and why not.

func Test

func Test(ctx context.Context, dir string, race bool, env []string) ([]*errs.Error, error)

Test runs the tests of every package of the module in dir, with the race detector when race is set, and with env, each KEY=value, in their environment in place of the variables of those names. It takes no result from the test cache, where a test could have written one.

func Tidy

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

Tidy runs go mod tidy in dir. It fails with E-CHK-006 when go mod tidy does, and with E-CHK-008 when a signal ends it.

func Vet

func Vet(ctx context.Context, dir string) ([]*errs.Error, error)

Vet runs go vet on every package of the module in dir. It turns off -v and -x, which GOFLAGS may set, so that the go command prints nothing but what vetProblems reads.

Types

This section is empty.

Jump to

Keyboard shortcuts

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