Documentation ¶
Index ¶
- Constants
- Variables
- func BuildMainPackages(workRoot string, modPaths []string, env environment.Environment) error
- func DownloadModules(modPaths []string, env environment.Environment) error
- func GetCombinedCoverage(coverFile string, env environment.Environment) (string, error)
- func InstallGoimports(path string, env environment.Environment) error
- func InstallGolangCiLint(path string, env environment.Environment) error
- func ParseModulesAbsPaths(cwd string) ([]string, error)
- func SyncWorkspace(cwd string, env environment.Environment) error
- func TestWorkspace(cwd string, modPaths []string, profileDir string, env environment.Environment, ...) error
- func TidyModules(modPaths []string, env environment.Environment) error
- func WorkspaceGenerate(modPaths []string, env environment.Environment) error
- type GoPackage
Constants ¶
const ( // CoverageManifest is the manifest filename CoverageManifest = "manifest.json" // CoverageExt is the file extension used by coverage files CoverageExt = ".coverage" // CombinedCoverage is the combined coverage report filename CombinedCoverage = "combined" + CoverageExt )
Variables ¶
var ( // Default path to store Go coverage DefaultCoveragePath = filepath.Join("tmp", "coverage") )
var (
ErrTotalCoverageNotFound = errors.New("total coverage not found")
)
Functions ¶
func BuildMainPackages ¶
func BuildMainPackages(workRoot string, modPaths []string, env environment.Environment) error
BuildMainPackages builds all main packages for a list of module paths
func DownloadModules ¶
func DownloadModules(modPaths []string, env environment.Environment) error
DownloadModules runs go mod download for all module paths passed
func GetCombinedCoverage ¶
func GetCombinedCoverage(coverFile string, env environment.Environment) (string, error)
GetCombinedCoverage takes a coverage file and returns a string representation of percentage of statements covered
func InstallGoimports ¶
func InstallGoimports(path string, env environment.Environment) error
InstallGoimports runs go install for the latest version of `goimports`
func InstallGolangCiLint ¶
func InstallGolangCiLint(path string, env environment.Environment) error
InstallGolangCiLint runs go install for the currently supported golangci-lint version
func ParseModulesAbsPaths ¶
ParseModulesAbsPaths parses the modules listed in the go.work file from the given directory and returns a list of absolute paths to those modules
func SyncWorkspace ¶
func SyncWorkspace(cwd string, env environment.Environment) error
SyncWorkspace runs go work sync in the given directory with a given set of environment variables
func TestWorkspace ¶
func TestWorkspace(cwd string, modPaths []string, profileDir string, env environment.Environment, integration bool) error
TestWorkspace runs all Go tests for a given workspace. Setting integration to true will run integration tests, otherwise we only run unit tests
func TidyModules ¶
func TidyModules(modPaths []string, env environment.Environment) error
TidyModules runs go mod tidy for all module paths passed Do not use currently, since go mod tidy is not compatible with go workspaces out of the box
func WorkspaceGenerate ¶
func WorkspaceGenerate(modPaths []string, env environment.Environment) error
WorkspaceGenerate runs go generate ./... for all module paths passed