diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index c85b8e5eb..899d27fbc 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -190,6 +190,7 @@ func (c *AppConfig) SaveAppState() error { return ioutil.WriteFile(filepath, marshalledAppState, 0644) } +// LoadAppState loads recorded AppState from file func (c *AppConfig) LoadAppState() error { filepath, err := prepareConfigFile("state.yml") if err != nil { @@ -205,6 +206,7 @@ func (c *AppConfig) LoadAppState() error { return yaml.Unmarshal(appStateBytes, c.AppState) } +// GetDefaultConfig returns the application default configuration func GetDefaultConfig() []byte { return []byte( `gui: diff --git a/pkg/updates/updates.go b/pkg/updates/updates.go index ad5dd57b6..5f533e5a0 100644 --- a/pkg/updates/updates.go +++ b/pkg/updates/updates.go @@ -22,7 +22,7 @@ import ( "github.com/sirupsen/logrus" ) -// Update checks for updates and does updates +// Updater checks for updates and does updates type Updater struct { Log *logrus.Entry Config config.AppConfigurer @@ -30,7 +30,7 @@ type Updater struct { Tr *i18n.Localizer } -// Updater implements the check and update methods +// Updaterer implements the check and update methods type Updaterer interface { CheckForNewUpdate() Update() @@ -78,6 +78,7 @@ func (u *Updater) getLatestVersionNumber() (string, error) { return dat["tag_name"].(string), nil } +// RecordLastUpdateCheck records last time an update check was performed func (u *Updater) RecordLastUpdateCheck() error { u.Config.GetAppState().LastUpdateCheck = time.Now().Unix() return u.Config.SaveAppState() diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 62706559e..0b6ffeddd 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -83,6 +83,7 @@ func GetProjectRoot() string { return strings.Split(dir, "lazygit")[0] + "lazygit" } +// Loader dumps a string to be displayed as a loader func Loader() string { characters := "|/-\\" now := time.Now()