From 5bf538c5ec9661649230be5f6a68d72d772fcbd4 Mon Sep 17 00:00:00 2001 From: Moritz Marquardt Date: Tue, 2 Apr 2024 21:14:03 +0200 Subject: [PATCH] Format go code --- server/cache/memory.go | 3 ++- server/cache/redis.go | 3 ++- server/certificates/certificates.go | 3 ++- server/dns/dns.go | 3 ++- server/handler/handler.go | 3 ++- server/handler/handler_custom_domain.go | 3 ++- server/handler/handler_test.go | 3 ++- server/startup.go | 5 +++-- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/server/cache/memory.go b/server/cache/memory.go index 30ebcfe..6b490ba 100644 --- a/server/cache/memory.go +++ b/server/cache/memory.go @@ -1,8 +1,9 @@ package cache import ( - "github.com/OrlovEvgeny/go-mcache" "time" + + "github.com/OrlovEvgeny/go-mcache" ) type MCache struct { diff --git a/server/cache/redis.go b/server/cache/redis.go index b56d118..a7ed6da 100644 --- a/server/cache/redis.go +++ b/server/cache/redis.go @@ -3,9 +3,10 @@ package cache import ( "context" "errors" + "time" + "github.com/redis/go-redis/v9" "github.com/rs/zerolog/log" - "time" ) type RedisCache struct { diff --git a/server/certificates/certificates.go b/server/certificates/certificates.go index 5ff8b08..763c6cf 100644 --- a/server/certificates/certificates.go +++ b/server/certificates/certificates.go @@ -6,11 +6,12 @@ import ( "crypto/x509" "errors" "fmt" - "github.com/OrlovEvgeny/go-mcache" "strconv" "strings" "time" + "github.com/OrlovEvgeny/go-mcache" + "github.com/go-acme/lego/v4/certcrypto" "github.com/go-acme/lego/v4/certificate" "github.com/go-acme/lego/v4/challenge/tlsalpn01" diff --git a/server/dns/dns.go b/server/dns/dns.go index 9904396..22be42c 100644 --- a/server/dns/dns.go +++ b/server/dns/dns.go @@ -1,10 +1,11 @@ package dns import ( - "github.com/OrlovEvgeny/go-mcache" "net" "strings" "time" + + "github.com/OrlovEvgeny/go-mcache" ) // lookupCacheTimeout specifies the timeout for the DNS lookup cache. diff --git a/server/handler/handler.go b/server/handler/handler.go index c68ee06..63a98ba 100644 --- a/server/handler/handler.go +++ b/server/handler/handler.go @@ -1,10 +1,11 @@ package handler import ( - "github.com/OrlovEvgeny/go-mcache" "net/http" "strings" + "github.com/OrlovEvgeny/go-mcache" + "github.com/rs/zerolog/log" "codeberg.org/codeberg/pages/config" diff --git a/server/handler/handler_custom_domain.go b/server/handler/handler_custom_domain.go index ee7a629..ef6e11e 100644 --- a/server/handler/handler_custom_domain.go +++ b/server/handler/handler_custom_domain.go @@ -1,11 +1,12 @@ package handler import ( - "github.com/OrlovEvgeny/go-mcache" "net/http" "path" "strings" + "github.com/OrlovEvgeny/go-mcache" + "codeberg.org/codeberg/pages/html" "codeberg.org/codeberg/pages/server/cache" "codeberg.org/codeberg/pages/server/context" diff --git a/server/handler/handler_test.go b/server/handler/handler_test.go index 254402f..5c3aa50 100644 --- a/server/handler/handler_test.go +++ b/server/handler/handler_test.go @@ -1,12 +1,13 @@ package handler import ( - "github.com/OrlovEvgeny/go-mcache" "net/http" "net/http/httptest" "testing" "time" + "github.com/OrlovEvgeny/go-mcache" + "codeberg.org/codeberg/pages/config" "codeberg.org/codeberg/pages/server/cache" "codeberg.org/codeberg/pages/server/gitea" diff --git a/server/startup.go b/server/startup.go index d93ff5d..925cfd1 100644 --- a/server/startup.go +++ b/server/startup.go @@ -5,14 +5,15 @@ import ( "crypto/tls" "encoding/json" "fmt" - "github.com/OrlovEvgeny/go-mcache" - "github.com/redis/go-redis/v9" "net" "net/http" "os" "strings" "time" + "github.com/OrlovEvgeny/go-mcache" + "github.com/redis/go-redis/v9" + "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/urfave/cli/v2"