Fix typo, updates from vscode

This commit is contained in:
2023-12-02 15:59:05 -06:00
parent 349ef0b0e1
commit 5d47e8d03c
2 changed files with 7 additions and 5 deletions

11
main.go
View File

@ -5,9 +5,6 @@ import (
"errors" "errors"
"flag" "flag"
"fmt" "fmt"
"github.com/goccy/go-json"
"github.com/joho/godotenv"
"github.com/valyala/fastjson"
"io" "io"
"log" "log"
"net/http" "net/http"
@ -15,6 +12,10 @@ import (
"os" "os"
"strconv" "strconv"
"time" "time"
"github.com/goccy/go-json"
"github.com/joho/godotenv"
"github.com/valyala/fastjson"
) )
var ( 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") fmt.Println("Too soon since the last request; doing nothing")
return return
} }
@ -181,7 +182,7 @@ func main() {
)) ))
} }
if day.Part2 != nil && lastMember.CompletionDayLevel[idx].Part2 == nil { 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 rank := getCompletionRank(&leaderboard, &member, idx, 2) + 1
ordinal := getOrdinal(rank) ordinal := getOrdinal(rank)
sendNotification(fmt.Sprintf( sendNotification(fmt.Sprintf(

1
staticcheck.conf Normal file
View File

@ -0,0 +1 @@
checks = ["all", "-U1000", "-ST1000", "-ST1005"]