Documentation
¶
Index ¶
- Constants
- Variables
- func Assert(condition bool, message string)
- func AssertGoBuild(args []string)
- func AssertType[T any](v any) T
- func CopyDir(src string, dst string) error
- func CopyDirExclude(src string, dst string, exclude []string) error
- func CopyFile(src, dst string) error
- func Crc32(s string) string
- func FindFlagValue(cmd []string, flag string) string
- func GetInstrumentLogPath(name string) string
- func GetLogPath(name string) string
- func GetLoggerPath() string
- func GetMatchedRuleFile() string
- func GetPreprocessLogPath(name string) string
- func GetTempBuildDir() string
- func GetTempBuildDirWith(name string) string
- func GetToolName() (string, error)
- func GetVarNameOfFunc(fn string) string
- func HasGoBuildComment(text string) bool
- func InInstrument() bool
- func InPreprocess() bool
- func IsCgo1GoFile(path string) bool
- func IsCgoCommand(line string) bool
- func IsCompileCommand(line string) bool
- func IsGoFile(path string) bool
- func IsGoModFile(path string) bool
- func IsGoSumFile(path string) bool
- func IsGoTestFile(path string) bool
- func IsModPath(path string) bool
- func IsUnix() bool
- func IsWindows() bool
- func Jsonify(v interface{}) string
- func ListFiles(dir string) ([]string, error)
- func Log(format string, args ...interface{})
- func PathExists(path string) bool
- func PathNotExists(path string) bool
- func PhaseTimer(name string) func()
- func ReadFile(filePath string) (string, error)
- func RemoveGoBuildComment(text string) string
- func RenamePackage(source, newPkgName string) string
- func RunCmd(args ...string) error
- func SetLogger(w *os.File)
- func SetRunPhase(phase RunPhase)
- func ShouldNotReachHere()
- func SplitCompileCmds(input string) []string
- func Unimplemented(message string)
- func WriteFile(filePath string, content string) (string, error)
- type RunPhase
Constants ¶
View Source
const ( GoBuildIgnoreComment = "//go:build ignore" GoModFile = "go.mod" GoSumFile = "go.sum" GoWorkSumFile = "go.work.sum" DebugLogFile = "debug.log" TempBuildDir = ".otel-build" )
View Source
const ( BuildPattern = "-p" BuildImportPath = "-importpath" BuildGoVer = "-goversion" BuildPgoProfile = "-pgoprofile" BuildModeVendor = "-mod=vendor" BuildModeMod = "-mod=mod" BuildWork = "-work" )
View Source
const ( PInvalid = "invalid" PPreprocess = "preprocess" PInstrument = "instrument" )
Variables ¶
View Source
var Guarantee = Assert // More meaningful name:)
Functions ¶
func AssertGoBuild ¶
func AssertGoBuild(args []string)
func AssertType ¶
func FindFlagValue ¶
func GetInstrumentLogPath ¶
func GetLogPath ¶
func GetLoggerPath ¶
func GetLoggerPath() string
func GetMatchedRuleFile ¶
func GetMatchedRuleFile() string
func GetPreprocessLogPath ¶
func GetTempBuildDir ¶
func GetTempBuildDir() string
func GetTempBuildDirWith ¶
func GetToolName ¶
func GetVarNameOfFunc ¶
func HasGoBuildComment ¶
func InInstrument ¶
func InInstrument() bool
func InPreprocess ¶
func InPreprocess() bool
func IsCgo1GoFile ¶
func IsCgoCommand ¶
func IsCompileCommand ¶
func IsGoModFile ¶
func IsGoSumFile ¶
func IsGoTestFile ¶
func PathExists ¶
func PathNotExists ¶
func PhaseTimer ¶
func PhaseTimer(name string) func()
func RemoveGoBuildComment ¶
func RenamePackage ¶
func SetRunPhase ¶
func SetRunPhase(phase RunPhase)
func ShouldNotReachHere ¶
func ShouldNotReachHere()
func SplitCompileCmds ¶
SplitCompileCmds splits the command line by space, but keep the quoted part as a whole. For example, "a b" c will be split into ["a b", "c"].
func Unimplemented ¶
func Unimplemented(message string)
Types ¶
Click to show internal directories.
Click to hide internal directories.