gocmd

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MPL-2.0 Imports: 7 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gocmd provides functions for working with the Go tool. This package is not named "go" because that name collides with a reserved keyword.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name(importPath string) string

Name computes the vendored import path of a package given its fully qualified import name.

Types

type Go

type Go struct {
	Cmd string
	Dir string
}

Go contains configuration information for the Go tool.

func (*Go) Build

func (g *Go) Build(pkgs []string) error

Build runs `go build` for packages.

func (*Go) Clean

func (g *Go) Clean(pkgs []string) error

Clean runs `go clean` for packages.

func (*Go) List

func (g *Go) List(pkgs, flags []string, vendor bool) ([]Package, error)

List runs `go list` to return information about packages.

func (*Go) ListOne

func (g *Go) ListOne(pkg string, flags []string, vendor bool) (Package, error)

ListOne runs List for a single package.

type GoListOutput

type GoListOutput struct {
	Name       string
	ImportPath string
	Dir        string
	Standard   bool
	Imports    []string
	Deps       []string
	Error      *GoListPackageError
	DepsErrors []*GoListPackageError
}

GoListOutput is a subset of the output of `go list`. See `go help list` for details.

type GoListPackageError

type GoListPackageError struct {
	ImportStack []string
	Pos         string
	Err         string
}

GoListPackageError is the PackageError struct defined in `go help list`.

type Package

type Package struct {
	Name       string      // Vendored import name (what would go into an `import` statement).
	ImportPath string      // Fully qualified import name (including `vendor` folders).
	Dir        string      // Absolute location on filesystem.
	IsInternal bool        // Whether the package is an internal package.
	IsStdLib   bool        // Whether the package is a part of the standard library.
	Imports    []string    // Direct dependencies.
	Deps       []string    // Transitive dependencies.
	Error      interface{} // A package loading error, if applicable.
}

Package represents a single Go package.

Jump to

Keyboard shortcuts

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