Documentation ¶
Overview ¶
Package util includes utility/helper functions that may be useful to other modules.
- Copyright (C) 2023 Intel Corporation
- SPDX-License-Identifier: MIT
Index ¶
- func AbsPath(path string) (string, error)
- func DirectoryExists(path string) (exists bool, err error)
- func ExpandUser(path string) string
- func FileExists(path string) (exists bool, err error)
- func StringInList(s string, l []string) bool
- func StringIndexInList(s string, l []string) (idx int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsPath ¶
AbsPath returns absolute path after expanding '~' to user's home dir Useful when application is started by a process that isn't a shell, e.g. PKB Use everywhere in place of filepath.Abs()
func DirectoryExists ¶
DirectoryExists returns whether the given directory (not a file) exists
func ExpandUser ¶
ExpandUser expands '~' to user's home directory, if found, otherwise returns original path
func FileExists ¶
FileExists returns whether the given file (not a directory) exists
func StringInList ¶
StringInList confirms if string is in list of strings
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.