Documentation
¶
Index ¶
- Constants
- Variables
- func AzldevProjectDir() string
- func BinDir() string
- func BuildDir() string
- func CreateBinDir() error
- func CreateBuildDir() error
- func CreateLicenseDir() error
- func CreateOutDir() error
- func GetToolAbsPath(toolName string) (toolPath string, err error)
- func LicenseDir() string
- func MagePrintf(msgType MessageType, text string, args ...interface{})
- func MagePrintln(msgType MessageType, a ...any)
- func OutDir() string
- func PrintAndReturnError(text string, generalError, specificError error) error
- func ScenarioDir() string
- type MessageType
Constants ¶
const ( GocovTool = "gocov" GocovXMLTool = "gocov-xml" GolangciLintTool = "golangci-lint" EditorconfigCheckerTool = "editorconfig-checker" GoLicenseTool = "go-licenses" GoStringerTool = "stringer" )
const (
// MageColorEnableEnvVar is the environment variable that enables color in mage.
MageColorEnableEnvVar = "MAGEFILE_ENABLE_COLOR"
)
The most reliable way to pass data to go tests is through environment variables. This file contains the environment variables used by the magefiles and understood by the tests.
Variables ¶
Functions ¶
func AzldevProjectDir ¶
func AzldevProjectDir() string
func CreateBinDir ¶
func CreateBinDir() error
func CreateBuildDir ¶
func CreateBuildDir() error
func CreateLicenseDir ¶
func CreateLicenseDir() error
func CreateOutDir ¶
func CreateOutDir() error
func GetToolAbsPath ¶
GetToolAbsPath returns the command to run a go tool that is managed within one of the tools-focused modules in this repository.
func LicenseDir ¶
func LicenseDir() string
func MagePrintf ¶
func MagePrintf(msgType MessageType, text string, args ...interface{})
MagePrintf prints a message with a message type and formatted text.
func MagePrintln ¶
func MagePrintln(msgType MessageType, a ...any)
MagePrintln prints a message with a message type and text without formatting.
func PrintAndReturnError ¶
PrintAndReturnError prints an error message, then returns a wrapped error. generalError should usually be a step error (e.g., ErrCheck, ErrBuild, etc.), while specificError should be the error that caused the step error (e.g., file not found, etc.). If specificError is nil, generalError is returned without wrapping.
i.e., PrintAndReturnError("Can't do step", "step failed", "file not found"):
prints "Can't do step" returns error("step failed: file not found")
PrintAndReturnError("Can't do step", "step failed", nil):
prints "Can't do step" returns error("step failed").
func ScenarioDir ¶
func ScenarioDir() string
Types ¶
type MessageType ¶
type MessageType int
const ( MsgStart MessageType = iota MsgInfo MsgWarning MsgError MsgSuccess )