gocmd

package
v0.0.0-...-265963b Latest Latest
Warning

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

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

Documentation

Overview

Package gocmd provides helers for invoking Go tooling.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBuildConstraint is returned when the Go command returns this error.
	ErrBuildConstraint error = errors.New("build constraints exclude all Go files")
)

Functions

func Build

func Build(dir string) error

Build attempts to build all packages recursively from the given directory.

func ListModDirName

func ListModDirName(dir string) (string, error)

ListModDirName finds the directory in which the module resides. Returns ErrBuildConstraint if all files in a module are constrained.

func ListModName

func ListModName(dir string) (string, error)

ListModName finds a modules name for a given directory.

func ModTidy

func ModTidy(dir string) error

ModTidy tidies go.mod file in the specified directory.

func ModTidyAll

func ModTidyAll(dir string) error

ModTidyAll tidies all mod files from the specified root directory.

func Vet

func Vet(dir string) error

Vet runs linters on all .go files recursively from the given directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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