From 8939f554188f13309e0a8a37dfb9370fdfc12f5d Mon Sep 17 00:00:00 2001 From: Peter Bwire Date: Sat, 16 Mar 2024 14:36:19 +0300 Subject: [PATCH] clean lint errors --- authentication.go | 5 +---- datastore.go | 2 -- logger.go | 6 ------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/authentication.go b/authentication.go index 44820d0..bb9edf6 100644 --- a/authentication.go +++ b/authentication.go @@ -280,10 +280,7 @@ func (s *Service) getPemCert(token *jwt.Token) (any, error) { return nil, err } defer func(Body io.ReadCloser) { - err := Body.Close() - if err != nil { - - } + _ = Body.Close() }(resp.Body) jwkKeyBytes, err = io.ReadAll(resp.Body) if err != nil { diff --git a/datastore.go b/datastore.go index 1d9f24b..92b4420 100644 --- a/datastore.go +++ b/datastore.go @@ -55,13 +55,11 @@ func DBPropertiesToMap(props datatypes.JSONMap) map[string]string { case bool: payload[k] = strconv.FormatBool(v) - break case int, int64, int32, int16, int8: payload[k] = strconv.FormatInt(int64(val.(int)), 10) case float32, float64: payload[k] = strconv.FormatFloat(val.(float64), 'g', -1, 64) - break default: marVal, err1 := json.Marshal(val) diff --git a/logger.go b/logger.go index 8acf42b..96b1cc6 100644 --- a/logger.go +++ b/logger.go @@ -52,23 +52,17 @@ func Logger() Option { switch logLevel { case "debug": logger.SetLevel(logrus.DebugLevel) - break case "trace": logger.SetLevel(logrus.TraceLevel) - break case "warn": logger.SetLevel(logrus.WarnLevel) - break case "error": logger.SetLevel(logrus.ErrorLevel) - break case "fatal": logger.SetLevel(logrus.FatalLevel) - break default: logger.SetLevel(logrus.InfoLevel) - break } s.logger = logger