Fix CentralTime init order (again)

This commit is contained in:
2023-12-26 08:07:09 -06:00
parent 14295d1264
commit 44d5e533f3
2 changed files with 8 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ import (
"os/signal"
"syscall"
"time"
_ "time/tzdata"
"github.com/bwmarrin/discordgo"
"github.com/joho/godotenv"
@@ -26,11 +27,18 @@ var (
isDevelopment bool
baseURL string // Base URL for all requests to the banner system
environment string
CentralTime *time.Location
)
func init() {
ctx = context.Background()
var err error
CentralTime, err = time.LoadLocation("America/Chicago")
if err != nil {
panic(err)
}
// Set zerolog's timestamp function to use the central timezone
zerolog.TimestampFunc = func() time.Time {
return time.Now().In(CentralTime)