files

package
v0.0.0-...-29bf162 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileEmpty

func FileEmpty(path string) (bool, error)

func FileExists

func FileExists(path string) bool

func GetGopath

func GetGopath() string

func GetProjectRoot

func GetProjectRoot(file string) string

func GetProjectRootParent

func GetProjectRootParent(file string) string

func IsDirWriteable

func IsDirWriteable(dir string) error

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 RelativeToPkgMod(file string) string

func RelativeToProjectRoot

func RelativeToProjectRoot(path string) string

func RelativeToProjectRootParent

func RelativeToProjectRootParent(path string) string

Types

type LookupPathFn

type LookupPathFn = func() (string, error)

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

Jump to

Keyboard shortcuts

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