empty string period is inf
All checks were successful
cicd / ci (push) Successful in 2m36s

This commit is contained in:
Bel LaPointe
2026-03-04 08:14:07 -07:00
parent 7262f5f69b
commit 86b8e62862
2 changed files with 6 additions and 2 deletions

View File

@@ -74,6 +74,10 @@ func (period *Period) setStop(s string) 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 {
*t = result
return result.AddDate(1, 0, 0).Add(-1 * time.Minute), nil

View File

@@ -353,7 +353,7 @@ func Main() {
}
f, err := os.Open(config.CSV)
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()
reader := csv.NewReader(f)
@@ -384,7 +384,7 @@ func Main() {
break
}
if err != nil {
log.Fatalf("failed to read csv line: %w", err)
log.Fatalf("failed to read csv line: %v", err)
}
dates := []string{}