futil

package
v0.0.0-...-c6ea6ab Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: LGPL-3.0 Imports: 3 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectRootNotFound1 = errutil.NewFactory("project root not found from: %q")
)

errors

Functions

func IsDir

func IsDir(path string) bool

IsDir return true if path exist and is directory

func IsExist

func IsExist(path string) bool

IsExist return true if path exist

https://gist.github.com/mattes/d13e273314c3b3ade33f

if _, err := os.Stat("/path/to/whatever"); err == nil {
	// path/to/whatever exists
}

func IsNotExist

func IsNotExist(path string) bool

IsNotExist return true if path not exist

https://gist.github.com/mattes/d13e273314c3b3ade33f

if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
	// path/to/whatever does not exist
}

func SearchProjectRoot

func SearchProjectRoot(
	searchFromDir string,
	mustExist []string,
	devExist []string,
	prodExist []string,
) (dir string, err error)

SearchProjectRoot return project root dir if possible, searchFromDir will set to current working directory if empty

Types

This section is empty.

Jump to

Keyboard shortcuts

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