diff --git a/pkg/ginserver/ginhandler.go b/pkg/ginserver/ginhandler.go index 52b23c0..6faa3f7 100644 --- a/pkg/ginserver/ginhandler.go +++ b/pkg/ginserver/ginhandler.go @@ -13,8 +13,7 @@ func GinHandler(c *gin.Context) { c.String(http.StatusMethodNotAllowed, http.StatusText(http.StatusMethodNotAllowed)) return } - currentTime := time.Now() - formattedTime := currentTime.Format(time.ANSIC) + formattedTime := time.Now().Format(time.ANSIC) if strings.Contains(c.Request.Header.Get("content-type"), "text/plain") { c.Writer.Header().Set("Content-Type", "text/plain") diff --git a/pkg/ginserver/ginhandler_test.go b/pkg/ginserver/ginhandler_test.go index 39663c3..f192063 100644 --- a/pkg/ginserver/ginhandler_test.go +++ b/pkg/ginserver/ginhandler_test.go @@ -22,9 +22,6 @@ func assertEquality(t *testing.T, obj1 any, obj2 any) { } } - - - func TestGinHome(t *testing.T) { r := gin.Default() diff --git a/pkg/httpserver/httphandler.go b/pkg/httpserver/httphandler.go index 79f6a7e..741a273 100644 --- a/pkg/httpserver/httphandler.go +++ b/pkg/httpserver/httphandler.go @@ -18,8 +18,7 @@ func HttpHandler(w http.ResponseWriter, r *http.Request) { http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) return } - currentTime := time.Now() - formattedTime := currentTime.Format(time.ANSIC) + formattedTime := time.Now().Format(time.ANSIC) if strings.Contains(r.Header.Get("content-type"), "text/plain") { diff --git a/pkg/httpserver/httphandler_test.go b/pkg/httpserver/httphandler_test.go index ab0b5a9..4615251 100644 --- a/pkg/httpserver/httphandler_test.go +++ b/pkg/httpserver/httphandler_test.go @@ -8,7 +8,6 @@ import ( "reflect" "testing" "time" - ) func assertEquality(t *testing.T, obj1 any, obj2 any) { @@ -109,4 +108,3 @@ func TestHttpHandler(t *testing.T) { } } -