Documentation ¶
Index ¶
- func FileEmpty(path string) (bool, error)
- func FileExists(path string) bool
- func GetGopath() string
- func GetProjectRoot(file string) string
- func GetProjectRootParent(file string) string
- func IsDirWriteable(dir string) error
- func LookupBinaryPath(pathFns ...LookupPathFn) (string, error)
- func RelativeToPkgMod(file string) string
- func RelativeToProjectRoot(path string) string
- func RelativeToProjectRootParent(path string) string
- type LookupPathFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
func GetProjectRoot ¶
func GetProjectRootParent ¶
func IsDirWriteable ¶
IsDirWriteable checks if dir is writable by writing and removing a file to dir. It returns nil if dir is writable.
func LookupBinaryPath ¶
func LookupBinaryPath(pathFns ...LookupPathFn) (string, error)
LookupBinaryPath looks for a binary in order of passed lookup functions. It fails only if all lookup function does not contain a binary.
func RelativeToPkgMod ¶
func RelativeToProjectRoot ¶
Types ¶
type LookupPathFn ¶
func LookupInCurrentDirectory ¶
func LookupInCurrentDirectory(binary string) LookupPathFn
LookupInCurrentDirectory looks for the binary in the current directory Example: if this function is executed by /usr/bin/dubbo-dp that was run in /home/dubbo-dp, this function will lookup for binary 'x' in /home/dubbo-dp/x
func LookupInPath ¶
func LookupInPath(path string) LookupPathFn
func LookupNextToCurrentExecutable ¶
func LookupNextToCurrentExecutable(binary string) LookupPathFn
LookupNextToCurrentExecutable looks for the binary next to the current binary Example: if this function is executed by /usr/bin/dubbo-dp, this function will lookup for binary 'x' in /usr/bin/x