diff --git a/bin/gitfetch/gitfetch.go b/bin/gitfetch/gitfetch.go index e59cd67..a5e436f 100644 --- a/bin/gitfetch/gitfetch.go +++ b/bin/gitfetch/gitfetch.go @@ -11,8 +11,6 @@ import ( gterm "github.com/taigrr/gitgraph/term" ) -type DataSet map[time.Time]gico.WorkDay - func main() { r, err := git.PlainOpenWithOptions(".", &(git.PlainOpenOptions{DetectDotGit: true})) @@ -26,7 +24,7 @@ func main() { // year := time.Now().Year() // yearStart := time.Time{} // yearStart.AddDate(year, 0, 0) - data := make(DataSet) + data := gico.NewDataSet() err = cIter.ForEach(func(c *object.Commit) error { ts := c.Author.When commit := gico.Commit{Author: c.Author.Name, Message: c.Message, TimeStamp: ts} diff --git a/gico.go b/gico.go index 6598d70..1d8ac13 100644 --- a/gico.go +++ b/gico.go @@ -50,6 +50,10 @@ type Commit struct { type DataSet map[time.Time]WorkDay +func NewDataSet() DataSet { + return make(DataSet) +} + type WorkDay struct { Day time.Time `json:"day"` Count int `json:"count"`