From 1cfe05fffd947fc127b2e0ea13b9492cd7646b31 Mon Sep 17 00:00:00 2001 From: gjahn <gregor.jahn@bht-berlin.de> Date: Sat, 25 Nov 2023 00:41:28 +0100 Subject: [PATCH] Cosmetics * rework indentation of some configuration variables * rename some 'err' variables to '_' since they are not used --- configuration/config.go | 6 +++--- routing/routes_test.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configuration/config.go b/configuration/config.go index d0183c2..5787d0d 100644 --- a/configuration/config.go +++ b/configuration/config.go @@ -16,9 +16,9 @@ type Config struct { LogLevel string `env:"LOG_LEVE" envDefault:"error"` - Environment string `env:"ENV_NAME" envDefault:"development"` - Host string `env:"HOST" envDefault:"127.0.0.1"` - Port int16 `env:"PORT" envDefault:"3000"` + Environment string `env:"ENV_NAME" envDefault:"development"` + Host string `env:"HOST" envDefault:"127.0.0.1"` + Port int16 `env:"PORT" envDefault:"3000"` DatabaseHost string `env:"DB_HOST" envDefault:""` DatabasePort int16 `env:"DB_PORT" envDefault:"6379"` diff --git a/routing/routes_test.go b/routing/routes_test.go index bc1cdd8..5c9bfd8 100644 --- a/routing/routes_test.go +++ b/routing/routes_test.go @@ -115,7 +115,7 @@ func TestHealthRoute( t *testing.T ){ router, _, _, healthiness := setup() req := ht.NewRequest( "GET", "/health", nil ) - res, err := router.Test( req, -1 ) + res, _ := router.Test( req, -1 ) bodyContent, err := jsonToMap( &res.Body ) status := bodyContent[ "status" ].( string ) assert.Equal( t, http.StatusOK, res.StatusCode ) @@ -125,7 +125,7 @@ func TestHealthRoute( t *testing.T ){ *healthiness = false req = ht.NewRequest( "GET", "/health", nil ) - res, err = router.Test( req, -1 ) + res, _ = router.Test( req, -1 ) bodyContent, err = jsonToMap( &res.Body ) status = bodyContent[ "status" ].( string ) assert.Equal( t, http.StatusServiceUnavailable, res.StatusCode ) @@ -143,7 +143,7 @@ func TestEnvRoute( t *testing.T ){ os.Setenv( envVarName, envVarValue ) req := ht.NewRequest( "GET", "/env", nil ) - res, err := router.Test( req, -1 ) + res, _ := router.Test( req, -1 ) bodyContent, err := bodyToString( &res.Body ) assert.Equal( t, http.StatusOK, res.StatusCode ) assert.Nil( t, err ) @@ -152,7 +152,7 @@ func TestEnvRoute( t *testing.T ){ ( *config ).Environment = "production" req = ht.NewRequest( "GET", "/env", nil ) - res, err = router.Test( req, -1 ) + res, _ = router.Test( req, -1 ) assert.Equal( t, http.StatusForbidden, res.StatusCode ) } -- GitLab