doc: add and improve comments
This commit is contained in:
parent
6187122b81
commit
f19ab81dc8
11 changed files with 31 additions and 8 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
ChronoTomato "git.smsvc.net/pomodoro/ChronoTomato/pkg/models"
|
||||
)
|
||||
|
||||
// Expands the `~` in a passed filename
|
||||
func expandUnixPath(filename string) string {
|
||||
if strings.HasPrefix(filename, "~/") {
|
||||
dirname, _ := os.UserHomeDir()
|
||||
|
@ -19,12 +20,14 @@ func expandUnixPath(filename string) string {
|
|||
return filename
|
||||
}
|
||||
|
||||
// Checks if the passed file exists
|
||||
func FileExists(filename string) bool {
|
||||
_, err := os.Stat(expandUnixPath(filename))
|
||||
|
||||
return !os.IsNotExist(err)
|
||||
}
|
||||
|
||||
// Parses the ChronoTomato config in the passed config file
|
||||
func ParseConfig(filename string) ChronoTomato.Config {
|
||||
var config ChronoTomato.Config
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue