golang

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Platforms = PlatformList{
	Platform{Architecture: "386", Extension: "", OperatingSystem: "darwin"},
	Platform{Architecture: "amd64", Extension: "", OperatingSystem: "darwin"},
	Platform{Architecture: "arm", Extension: "", OperatingSystem: "darwin"},
	Platform{Architecture: "arm64", Extension: "", OperatingSystem: "darwin"},

	Platform{Architecture: "386", Extension: "", OperatingSystem: "freebsd"},
	Platform{Architecture: "amd64", Extension: "", OperatingSystem: "freebsd"},

	Platform{Architecture: "386", Extension: "", OperatingSystem: "linux"},
	Platform{Architecture: "amd64", Extension: "", OperatingSystem: "linux"},
	Platform{Architecture: "arm", Extension: "", OperatingSystem: "linux"},
	Platform{Architecture: "arm64", Extension: "", OperatingSystem: "linux"},

	Platform{Architecture: "386", Extension: "", OperatingSystem: "openbsd"},
	Platform{Architecture: "amd64", Extension: "", OperatingSystem: "openbsd"},

	Platform{Architecture: "386", Extension: "exe", OperatingSystem: "windows"},
	Platform{Architecture: "amd64", Extension: "exe", OperatingSystem: "windows"},
}

Platforms represents all the platforms that packages will compile for by default

Functions

func CreateGoCommand

func CreateGoCommand() *cobra.Command

CreateGoCommand creates the root Go command

func ListPackages

func ListPackages(path string, packagesToIgnore []string) ([]*build.Package, error)

ListPackages lists all go packages in the specified path and subpath, ignoring the list of packages specified.

func RunTestsWithCoverage

func RunTestsWithCoverage(packages []*build.Package) error

RunTestsWithCoverage runs tests for all packages and generate coverage data. This method is guarantee to generate coverage counts even when the package has no tests.

Types

type BuildSpecification

type BuildSpecification struct {
	BaseName        string
	FileToBuild     string
	LinkerArguments []string
	Platforms       PlatformList
}

BuildSpecification represents a spec to build a go binary

func (*BuildSpecification) Build

func (buildSpec *BuildSpecification) Build() []error

Build builds the binaries using the build spec

type Platform

type Platform struct {
	Architecture    string
	Extension       string
	OperatingSystem string
}

Platform represents a platform that binaries can be compiled for

type PlatformList

type PlatformList []Platform

PlatformList represent a list of available platforms

func (PlatformList) WithArchitectures

func (platforms PlatformList) WithArchitectures(architectures ...string) PlatformList

WithArchitectures filters the list of available platform to only include those with the specified architecture

func (PlatformList) WithOperatingSystems

func (platforms PlatformList) WithOperatingSystems(operatingSystems ...string) PlatformList

WithOperatingSystems filters the list of available platform to only include those with the specified operating system

Jump to

Keyboard shortcuts

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