From f5463ce62a2dae7f8eccc125b6f7264ad411e71a Mon Sep 17 00:00:00 2001 From: dustoair <107600816+dustoair@users.noreply.github.com> Date: Sat, 17 Sep 2022 20:52:59 +0800 Subject: [PATCH] diff getdays --- goCharts/draw.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/goCharts/draw.go b/goCharts/draw.go index 93b0325..2182b3a 100644 --- a/goCharts/draw.go +++ b/goCharts/draw.go @@ -71,14 +71,14 @@ func Draw(symbol string) { } } -func getLastDays(len int) []string { +func getLastDays(diff int) []string { now := time.Now() getDay := func(t time.Time, dif int) string { return t.AddDate(0, 0, dif).Format("01/02") } var res []string - for i := 1; i <= len; i++ { - res = append(res, getDay(now, i-len)) + for i := 1; i <= diff; i++ { + res = append(res, getDay(now, i-diff)) } return res }