Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrShouldNotReached = errors.New("should never be reached") ErrGocShouldExecInProject = errors.New("goc not executed in project directory") ErrWrongPackageTypeForInstall = errors.New("packages only support \".\" and \"./...\"") ErrWrongPackageTypeForBuild = errors.New("packages only support \".\"") ErrTooManyArgs = errors.New("too many args") ErrInvalidWorkingDir = errors.New("the working directory is invalid") ErrWrongCallSequence = errors.New("function should be called in a specified sequence") ErrNoplaceToInstall = errors.New("dont know where to install") )
Functions ¶
func TmpFolderName ¶
Types ¶
type Build ¶
type Build struct { Pkgs map[string]*cover.Package // Pkg list parsed from "go list -json ./..." command NewGOPATH string // the new GOPATH OriGOPATH string // the original GOPATH WorkingDir string // the working directory TmpDir string // the temporary directory to build the project TmpWorkingDir string // the working directory in the temporary directory, which is corresponding to the current directory in the project directory IsMod bool // determine whether it is a Mod project Root string // go 1.11, go 1.12 has no Root // Project Root: // 1. legacy, root == GOPATH // 2. mod, root == go.mod Dir Target string // the binary name that go build generate // keep compatible with go commands: // go run [build flags] [-exec xprog] package [arguments...] // go build [-o output] [-i] [build flags] [packages] // go install [-i] [build flags] [packages] BuildFlags string // Build flags Packages string // Packages that needs to build GoRunExecFlag string // for the -exec flags in go run command GoRunArguments string // for the '[arguments]' parameters in go run command }
Build is to describe the building/installing process of a goc build/install
func NewBuild ¶
func NewBuild(buildflags string, args []string, workingDir string, outputDir string) (*Build, error)
NewBuild creates a Build struct which can build from goc temporary directory, and generate binary in current working directory
func NewInstall ¶
NewInstall creates a Build struct which can install from goc temporary directory
func (*Build) MvProjectsToTmp ¶
Click to show internal directories.
Click to hide internal directories.