1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-20 05:19:24 +02:00

Merge pull request #241 from antham/master

Fix linting issues
This commit is contained in:
Jesse Duffield 2018-08-29 23:05:14 +10:00 committed by GitHub
commit d8aba3aeee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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()

View File

@ -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()