buildgo

package
v7.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package buildgo contains utilities used by plz_go_test. It's split up mostly for ease of testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsVersion18

func IsVersion18(goTool string) bool

IsVersion18 returns true if the given Go tool is version 1.8 or greater. This is needed because the test main signature has changed - it's not subject to the Go1 compatibility guarantee :(

func WriteTestMain

func WriteTestMain(pkgDir string, version18 bool, sources []string, output string, coverVars []CoverVar) error

WriteTestMain templates a test main file from the given sources to the given output file. This mimics what 'go test' does, although we do not currently support benchmarks or examples.

Types

type CoverVar

type CoverVar struct {
	Dir, ImportPath, ImportName, Var, File string
}

A CoverVar is just a combination of package path and variable name for one of the templated-in coverage variables.

func FindCoverVars

func FindCoverVars(dir string, exclude []string) ([]CoverVar, error)

FindCoverVars searches the given directory recursively to find all Go files with coverage variables.

Jump to

Keyboard shortcuts

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