Compare commits

..

1 Commits

Author SHA1 Message Date
Renovate Bot
2ac7f05e52 fix(deps): update module github.com/rs/zerolog to v1.34.0
All checks were successful
Build / build (pull_request) Successful in 1m51s
Lint / lint (pull_request) Successful in 2m27s
2025-03-22 07:02:33 +00:00
9 changed files with 11 additions and 23 deletions

View File

@ -15,6 +15,6 @@ jobs:
with: with:
go-version-file: 'go.mod' go-version-file: 'go.mod'
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v7 uses: golangci/golangci-lint-action@v6
with: with:
version: 'latest' version: 'latest'

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.22.6
require ( require (
github.com/gorilla/mux v1.8.1 github.com/gorilla/mux v1.8.1
github.com/justinas/alice v1.2.0 github.com/justinas/alice v1.2.0
github.com/pelletier/go-toml/v2 v2.2.4 github.com/pelletier/go-toml/v2 v2.2.3
github.com/rs/zerolog v1.34.0 github.com/rs/zerolog v1.34.0
) )

2
go.sum
View File

@ -11,8 +11,6 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=

View File

@ -15,8 +15,8 @@ const (
) )
type Timing struct { type Timing struct {
ExecutionTime time.Duration `json:"executionTime"` TimeMillis time.Duration `json:"timeMillis"`
Source string `json:"source"` Source string `json:"source"`
} }
type HealthCheckResult struct { type HealthCheckResult struct {
@ -43,8 +43,8 @@ func (app *Application) HealthCheck(w http.ResponseWriter, r *http.Request) {
Time: time.Now().UTC(), Time: time.Now().UTC(),
Timing: []Timing{ Timing: []Timing{
{ {
Source: "HealthCheck", Source: "HealthCheck",
ExecutionTime: time.Since(start), TimeMillis: time.Since(start),
}, },
}, },
Response: HealthCheckResponse{ Response: HealthCheckResponse{

View File

@ -13,7 +13,7 @@ func (app *Application) Index(w http.ResponseWriter, r *http.Request) {
reqId := RequestID(r) reqId := RequestID(r)
err := indexTemplate.Execute(w, templateData{ err := indexTemplate.Execute(w, templateData{
RequestID: reqId, RequestID: reqId,
}) })
if err != nil { if err != nil {
l.Error().Err(err).Msg("error executing template") l.Error().Err(err).Msg("error executing template")

View File

@ -1,7 +1,6 @@
package handlers_test package handlers_test
import ( import (
"fmt"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"testing" "testing"
@ -36,11 +35,7 @@ func TestIndex(t *testing.T) {
app.Handler().ServeHTTP(w, req) app.Handler().ServeHTTP(w, req)
// app.Index(w, req) // app.Index(w, req)
res := w.Result() res := w.Result()
defer func() { defer res.Body.Close()
if err := res.Body.Close(); err != nil {
fmt.Println("Received error: ", err)
}
}()
if res.StatusCode != 200 { if res.StatusCode != 200 {
t.Errorf("expected status to be 200, got %d", res.StatusCode) t.Errorf("expected status to be 200, got %d", res.StatusCode)

View File

@ -14,7 +14,7 @@ func (app *Application) NotFound(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound) w.WriteHeader(http.StatusNotFound)
err := notFoundTemplate.Execute(w, templateData{ err := notFoundTemplate.Execute(w, templateData{
RequestID: reqId, RequestID: reqId,
}) })
if err != nil { if err != nil {
l.Error().Err(err).Msg("error executing template") l.Error().Err(err).Msg("error executing template")

View File

@ -1,7 +1,6 @@
package handlers_test package handlers_test
import ( import (
"fmt"
"io" "io"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
@ -17,11 +16,7 @@ func TestNotFound(t *testing.T) {
app.Handler().ServeHTTP(w, req) app.Handler().ServeHTTP(w, req)
res := w.Result() res := w.Result()
defer func() { defer res.Body.Close()
if err := res.Body.Close(); err != nil {
fmt.Println("Received error: ", err)
}
}()
if res.StatusCode != 404 { if res.StatusCode != 404 {
t.Errorf("expected status to be 404, got %d", res.StatusCode) t.Errorf("expected status to be 404, got %d", res.StatusCode)

View File

@ -10,7 +10,7 @@ var indexTemplate *template.Template
var notFoundTemplate *template.Template var notFoundTemplate *template.Template
type templateData struct { type templateData struct {
RequestID string RequestID string
} }
func (app *Application) ParseTemplates() error { func (app *Application) ParseTemplates() error {