Documentation ¶
Index ¶
- Variables
- func AddYamlExtension(file string) string
- func FileExists(file string) bool
- func FormatTime(t time.Time) string
- func LogErr(action string, err error)
- func MatchExtension(file string, exts []string) bool
- func MustGetUserHomeDir() string
- func MustGetwd() string
- func MustTempDir(pattern string) string
- func OpenOrCreateFile(file string) (*os.File, error)
- func ParseTime(val string) (time.Time, error)
- func SplitCommand(cmd string) (cmdx string, args []string)
- func SplitCommandWithParse(cmd string) (cmdx string, args []string)
- func TruncString(val string, max int) string
- func ValidFilename(str string) string
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnexpectedEOF = errors.New( "unexpected end of input after escape character", ) ErrUnknownEscapeSequence = errors.New("unknown escape sequence") )
Functions ¶
func AddYamlExtension ¶
AddYamlExtension adds .yaml extension if not present if it has .yml extension, replace it with .yaml
func MatchExtension ¶
MatchExtension returns true if extension matches.
func MustGetUserHomeDir ¶
func MustGetUserHomeDir() string
MustGetUserHomeDir returns current working directory. Panics is os.UserHomeDir() returns error
func MustGetwd ¶
func MustGetwd() string
MustGetwd returns current working directory. Panics is os.Getwd() returns error
func MustTempDir ¶
MustTempDir returns temporary directory. This function is used only for testing.
func OpenOrCreateFile ¶
OpenOrCreateFile opens file or creates it if it doesn't exist.
func SplitCommand ¶
SplitCommand splits command string to program and arguments.
func SplitCommandWithParse ¶
SplitCommandWithParse splits command string to program and arguments.
func TruncString ¶
TruncString TurnString returns truncated string.
func ValidFilename ¶
ValidFilename makes filename valid by replacing reserved characters.
Types ¶
This section is empty.