From 5d47e8d03c65eb2460fd277f730018d10a28252c Mon Sep 17 00:00:00 2001 From: Parnic Date: Sat, 2 Dec 2023 15:59:05 -0600 Subject: [PATCH] Fix typo, updates from vscode --- main.go | 11 ++++++----- staticcheck.conf | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 staticcheck.conf diff --git a/main.go b/main.go index a1c1a52..ba41796 100644 --- a/main.go +++ b/main.go @@ -5,9 +5,6 @@ import ( "errors" "flag" "fmt" - "github.com/goccy/go-json" - "github.com/joho/godotenv" - "github.com/valyala/fastjson" "io" "log" "net/http" @@ -15,6 +12,10 @@ import ( "os" "strconv" "time" + + "github.com/goccy/go-json" + "github.com/joho/godotenv" + "github.com/valyala/fastjson" ) var ( @@ -111,7 +112,7 @@ func main() { } } - if time.Now().Sub(time.Unix(lastRead, 0)) < time.Minute*15 { + if time.Since(time.Unix(lastRead, 0)) < time.Minute*15 { fmt.Println("Too soon since the last request; doing nothing") return } @@ -181,7 +182,7 @@ func main() { )) } if day.Part2 != nil && lastMember.CompletionDayLevel[idx].Part2 == nil { - completionTime := time.Unix(day.Part1.GetStarTimestamp, 0).In(ChicagoTimeZone).Format("3:04:05pm") + completionTime := time.Unix(day.Part2.GetStarTimestamp, 0).In(ChicagoTimeZone).Format("3:04:05pm") rank := getCompletionRank(&leaderboard, &member, idx, 2) + 1 ordinal := getOrdinal(rank) sendNotification(fmt.Sprintf( diff --git a/staticcheck.conf b/staticcheck.conf new file mode 100644 index 0000000..6f41538 --- /dev/null +++ b/staticcheck.conf @@ -0,0 +1 @@ +checks = ["all", "-U1000", "-ST1000", "-ST1005"]