Documentation
¶
Index ¶
- func CleanPath(path string) string
- func Contains[T comparable](arr []T, element T) bool
- func CreateFile(path string, contents []byte) error
- func Dir(filePath string) string
- func EnsureDirExists(path string) error
- func FileName(path string) string
- func FilenameWithoutExtension(path string) string
- func Filter[T any](arr []T, filter func(T) bool) []T
- func GetMapKeys[T any](m map[string]T) []string
- func GitCheckoutBranch(directory, name string) error
- func GitCloneRepository(url, directory string) error
- func GitIsValidGitRepository(directory string) bool
- func GitPullRepository(directory string) error
- func GitResetUncommittedChanges(directory string) error
- func Hash(args ...string) string
- func PathExists(path string) bool
- func PathPrepare(path string) string
- func PrintJson(obj any)
- func Walk(root string, walkFn filepath.WalkFunc) error
- type Cache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶ added in v0.2.0
func Contains[T comparable](arr []T, element T) bool
function to check if an element exists in a slice Example: Contains([]string{"a", "b", "c"}, "b") -> true
func CreateFile ¶
CreateFile creates a file at the given path and writes the contents to the file. It overwrites the file if it already exists.
func EnsureDirExists ¶
EnsureDirExists checks if a directory exists at the given path, and creates it if it doesn't exist.
func FilenameWithoutExtension ¶ added in v0.2.0
FilenameWithoutExtension from path
func GetMapKeys ¶ added in v0.2.0
func GetMapKeys is to get keys of map storing any type of values Example: GetMapKeys(map[string]int{"a": 1, "b": 2}) -> []string{"a", "b"}
func GitCheckoutBranch ¶ added in v0.2.0
func GitCheckoutBranch to checkout branch form name
func GitCloneRepository ¶ added in v0.2.0
func GitIsValidGitRepository ¶ added in v0.2.0
func GitPullRepository ¶ added in v0.2.0
func GitResetUncommittedChanges ¶ added in v0.2.0
func PathPrepare ¶ added in v0.2.0
PathPrepare replaces $HOME, $TMP, $CWD with their respective paths
Types ¶
Click to show internal directories.
Click to hide internal directories.