Version: v0.0.0-...-c97c800 Latest Latest

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

Go to latest
Published: Feb 6, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type BuildOpts

type BuildOpts struct {
	// ExtraArgs to `go build`.
	ExtraArgs []string

Optional arguments to Environ.Build.

type Environ

type Environ struct {

func Default

func Default() Environ

Default is the default build environment comprised of the default GOPATH, GOROOT, GOOS, GOARCH, and CGO_ENABLED values.

func (Environ) Build

func (c Environ) Build(importPath string, binaryPath string, opts BuildOpts) error

Build compiles the package given by `importPath`, writing the build object to `binaryPath`.

func (Environ) BuildDir

func (c Environ) BuildDir(dirPath string, binaryPath string, opts BuildOpts) error

BuildDir compiles the package in the directory `dirPath`, writing the build object to `binaryPath`.

func (Environ) Deps

func (c Environ) Deps(importPath string) (*ListPackage, error)

Deps lists all dependencies of the package given by `importPath`.

func (Environ) Env

func (c Environ) Env() []string

func (Environ) Package

func (c Environ) Package(importPath string) (*build.Package, error)

Package retrieves information about a package by its Go import path.

func (Environ) PackageByPath

func (c Environ) PackageByPath(path string) (*build.Package, error)

PackageByPath retrieves information about a package by its file system path.

`path` is assumed to be the directory containing the package.

func (Environ) String

func (c Environ) String() string

type ListPackage

type ListPackage struct {
	Dir        string
	Deps       []string
	GoFiles    []string
	SFiles     []string
	HFiles     []string
	Goroot     bool
	Root       string
	ImportPath string

ListPackage matches a subset of the JSON output of the `go list -json` command.

See `go help list` for the full structure.

This currently contains an incomplete list of dependencies.

Source Files

Jump to

Keyboard shortcuts

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