This commit is contained in:
@@ -74,6 +74,10 @@ func (period *Period) setStop(s string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*Period) setT(s string, t *time.Time) (time.Time, error) {
|
func (*Period) setT(s string, t *time.Time) (time.Time, error) {
|
||||||
|
if s == "" {
|
||||||
|
*t = time.Unix(0, 0)
|
||||||
|
return time.Now().AddDate(100, 0, 0), nil
|
||||||
|
}
|
||||||
if result, err := time.Parse("2006", s); err == nil {
|
if result, err := time.Parse("2006", s); err == nil {
|
||||||
*t = result
|
*t = result
|
||||||
return result.AddDate(1, 0, 0).Add(-1 * time.Minute), nil
|
return result.AddDate(1, 0, 0).Add(-1 * time.Minute), nil
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ func Main() {
|
|||||||
}
|
}
|
||||||
f, err := os.Open(config.CSV)
|
f, err := os.Open(config.CSV)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("cannot open csv %q: %w", config.CSV, err)
|
log.Fatalf("cannot open csv %q: %v", config.CSV, err)
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
reader := csv.NewReader(f)
|
reader := csv.NewReader(f)
|
||||||
@@ -384,7 +384,7 @@ func Main() {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to read csv line: %w", err)
|
log.Fatalf("failed to read csv line: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dates := []string{}
|
dates := []string{}
|
||||||
|
|||||||
Reference in New Issue
Block a user