From e889a40caf3a3b3b8ac3e7bc029310249a923d34 Mon Sep 17 00:00:00 2001 From: Anthony HAMON Date: Wed, 29 Aug 2018 13:31:27 +0200 Subject: [PATCH 1/4] fix golint issue --- pkg/utils/utils.go | 1 + 1 file changed, 1 insertion(+) 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() From cda7b374e2b95d4f6b71e896e775bc0d688cc710 Mon Sep 17 00:00:00 2001 From: Anthony HAMON Date: Wed, 29 Aug 2018 13:32:34 +0200 Subject: [PATCH 2/4] fix linting issues --- pkg/config/app_config.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index c85b8e5eb..0acd9d820 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: From 54326907c38565d970a6d15f685abbac80fcc9ea Mon Sep 17 00:00:00 2001 From: Anthony HAMON Date: Wed, 29 Aug 2018 13:34:56 +0200 Subject: [PATCH 3/4] fix linting issues --- pkg/updates/updates.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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() From 1b8836e92d7d59cf99d17d5df981337f459712df Mon Sep 17 00:00:00 2001 From: antham Date: Wed, 29 Aug 2018 13:45:52 +0200 Subject: [PATCH 4/4] fix fmt issue --- pkg/config/app_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 0acd9d820..899d27fbc 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -206,7 +206,7 @@ func (c *AppConfig) LoadAppState() error { return yaml.Unmarshal(appStateBytes, c.AppState) } - // GetDefaultConfig returns the application default configuration +// GetDefaultConfig returns the application default configuration func GetDefaultConfig() []byte { return []byte( `gui: