diff options
Diffstat (limited to 'repository')
-rw-r--r-- | repository/config.go | 2 | ||||
-rw-r--r-- | repository/config_git.go | 2 | ||||
-rw-r--r-- | repository/git.go | 12 | ||||
-rw-r--r-- | repository/repo.go | 6 |
4 files changed, 14 insertions, 8 deletions
diff --git a/repository/config.go b/repository/config.go index d72e7b4e..4fa5c69b 100644 --- a/repository/config.go +++ b/repository/config.go @@ -38,7 +38,7 @@ type Config interface { RemoveAll(keyPrefix string) error } -func parseTimestamp(s string) (time.Time, error) { +func ParseTimestamp(s string) (time.Time, error) { timestamp, err := strconv.Atoi(s) if err != nil { return time.Time{}, err diff --git a/repository/config_git.go b/repository/config_git.go index 63ca2457..cff82afb 100644 --- a/repository/config_git.go +++ b/repository/config_git.go @@ -116,7 +116,7 @@ func (gc *gitConfig) ReadTimestamp(key string) (time.Time, error) { if err != nil { return time.Time{}, err } - return parseTimestamp(value) + return ParseTimestamp(value) } func (gc *gitConfig) rmSection(keyPrefix string) error { diff --git a/repository/git.go b/repository/git.go index 2b00d1f2..2c72fccd 100644 --- a/repository/git.go +++ b/repository/git.go @@ -15,11 +15,15 @@ import ( "github.com/MichaelMure/git-bug/util/lamport" ) -const createClockFile = "/git-bug/create-clock" -const editClockFile = "/git-bug/edit-clock" +const ( + createClockFile = "/git-bug/create-clock" + editClockFile = "/git-bug/edit-clock" +) -// ErrNotARepo is the error returned when the git repo root wan't be found -var ErrNotARepo = errors.New("not a git repository") +var ( + // ErrNotARepo is the error returned when the git repo root wan't be found + ErrNotARepo = errors.New("not a git repository") +) var _ ClockedRepo = &GitRepo{} diff --git a/repository/repo.go b/repository/repo.go index 7d655bde..e8c67a5e 100644 --- a/repository/repo.go +++ b/repository/repo.go @@ -10,8 +10,10 @@ import ( "github.com/MichaelMure/git-bug/util/lamport" ) -var ErrNoConfigEntry = errors.New("no config entry for the given key") -var ErrMultipleConfigEntry = errors.New("multiple config entry for the given key") +var ( + ErrNoConfigEntry = errors.New("no config entry for the given key") + ErrMultipleConfigEntry = errors.New("multiple config entry for the given key") +) // RepoCommon represent the common function the we want all the repo to implement type RepoCommon interface { |