diff --git a/internal/api/router/endpoints.go b/internal/api/router/endpoints.go index 91b35cc..98d270a 100644 --- a/internal/api/router/endpoints.go +++ b/internal/api/router/endpoints.go @@ -19,12 +19,12 @@ const wildcard = "*" func healthCheck(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) { w.Header().Set(contentType, applicationJSON) - fmt.Fprintf(w, `{"status": "ok"}`) + _, _ = fmt.Fprintf(w, `{"status": "ok"}`) } func getVersion(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) { w.Header().Set(contentType, applicationJSON) - fmt.Fprintf(w, `{"version": "%s", "build_time": "%s", "build_user": "%s"}`, app.Info.Version, app.Info.BuildTime, app.Info.BuildUser) + _, _ = fmt.Fprintf(w, `{"version": "%s", "build_time": "%s", "build_user": "%s"}`, app.Info.Version, app.Info.BuildTime, app.Info.BuildUser) } func prometheusMetrics(h http.Handler) httprouter.Handle { diff --git a/internal/convertor/device/serializer.go b/internal/convertor/device/serializer.go index 64592b8..32bab44 100644 --- a/internal/convertor/device/serializer.go +++ b/internal/convertor/device/serializer.go @@ -1,7 +1,6 @@ package device import ( - "bytes" "encoding/json" "errors" @@ -94,18 +93,12 @@ func (s *SafeRepository) GetDeviceOpenConfigJSON(hostname string) ([]byte, error var config json.RawMessage var err error - out := bytes.NewBuffer(nil) if config, err = dev.GetCompactJSON(); err != nil { log.Error().Err(err).Send() return []byte(emptyJSON), err } - if err := json.Compact(out, []byte(dev.Config.JSON)); err != nil { - log.Error().Err(err).Send() - return []byte(emptyJSON), err - } - if r, err := json.Marshal(config); err != nil { log.Error().Err(err).Send() return []byte(emptyJSON), err