util

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ModuleFileName      = "MODULE"
	ModuleSyntaxVersion = 3

	BuildDirName = "BUILD"
	// DepsDirName is directory that dependencies are stored in.
	DepsDirName     = "DEPS"
	WarningFileName = "WARNING.readme.txt"
)

ModuleFileName is the name of the file describing each module.

Variables

View Source
var FlagNoWorkspaceChecks = false

Functions

func CheckWorkspace added in v1.3.15

func CheckWorkspace()

func CopyDirRecursively added in v1.3.2

func CopyDirRecursively(sourceDir, destDir string) error

Copies a directory recursing into its inner directories

func CopyFile

func CopyFile(sourceFile, destFile string)

func CutPrefix added in v1.3.12

func CutPrefix(str string, prefix string) (string, bool)

Reimplementation of CutPrefix for backwards compatibility with versions < 1.20

func DirExists

func DirExists(dir string) bool

DirExists checks whether some directory exists.

func EnsureManagedDir added in v1.3.15

func EnsureManagedDir(dir string)

func FileExists

func FileExists(file string) bool

FileExists checks whether some file exists.

func GetModuleRoot

func GetModuleRoot() string

GetModuleRoot returns the root directory of the current module.

func GetModuleRootForPath

func GetModuleRootForPath(p string) string

func GetWorkingDir added in v0.1.4

func GetWorkingDir() string

GetWorkingDir returns the current working directory.

func GetWorkspaceRoot

func GetWorkspaceRoot() string

GetWorkspaceRoot returns the root directory of the current workspace (i.e., top-level module).

func MkdirAll added in v1.0.0

func MkdirAll(p string)

MkdirAll creates directory `p` and all parent directories.

func ReadFile

func ReadFile(filePath string) []byte

func ReadJson added in v1.0.0

func ReadJson(filePath string, v interface{})

func ReadYaml added in v1.0.0

func ReadYaml(filePath string, v interface{})

func RemoveDir

func RemoveDir(p string)

RemoveDir removes a directory and all of its content.

func Version added in v1.4.0

func Version() string

func VersionTriplet added in v1.4.0

func VersionTriplet() [3]uint
func WalkSymlink(root string, walkFn filepath.WalkFunc) error

WalkSymlink works like filepath.Walk but also accepts symbolic links as `root`.

func WriteFile

func WriteFile(filePath string, data []byte)

func WriteJson added in v1.0.0

func WriteJson(filePath string, v interface{})

func WriteYaml added in v1.0.0

func WriteYaml(filePath string, v interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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