Documentation ¶
Index ¶
- func FileModDateCompare(file1, file2 string) (diff int, err error)
- func FileRoot(filename string) string
- func GetFlagString(key string) (string, bool)
- func GetIpAddress() string
- func IsDir(path string) bool
- func LaunchChrome(url string) (err error)
- func LaunchDefaultBrowser(url string) (err error)
- func PathExists(path string) bool
- func SourceDirectory() (dir string)
- func SourcePath() (file string)
- type WriterToFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileModDateCompare ¶
FileModDateCompare compares the modification date of two files, and returns -1 if the first is older than the second, 0 if they are the same, and 1 if the 2nd is older than the first. Returns an error if either is not a file.
func GetFlagString ¶ added in v0.14.0
GetFlagString returns the value of the given command line flag if it exists. This is sometimes needed to get to command line flags from init() functions. The value is a string, and can be in -key=value or -key value form.
func GetIpAddress ¶ added in v0.15.0
func GetIpAddress() string
GetIpAddress returns the string formatted ip address of the machine we are running on, as best can be determined.
func LaunchChrome ¶
LaunchChromeHeadlessBrowser will launch google chrome with the given url.
func LaunchDefaultBrowser ¶
LaunchDefaultBrowser launches the system's default browser and opens the browser to the given url. Not that most Linux systems do not have a default.
func PathExists ¶
PathExists returns true if the given path exists in the OS. This does not necessarily mean that the path is usable. It may be write or read protected. But at least you know its there.
func SourceDirectory ¶ added in v0.0.9
func SourceDirectory() (dir string)
SourceDirectory is a utility function that returns the path to the directory of the file that called it.
func SourcePath ¶ added in v0.0.9
func SourcePath() (file string)
SourcePath is a utility function that returns the path to the file that called it.