From 5b4af0584d1c66b4f8d3d721374541fb76b5b395 Mon Sep 17 00:00:00 2001
From: Paul Holzinger <pholzing@redhat.com>
Date: Fri, 22 Apr 2022 13:38:41 +0200
Subject: replace golint with revive linter

golint, scopelint and interfacer are deprecated. golint is replaced by
revive. This linter is better because it will also check for our error
style: `error strings should not be capitalized or end with punctuation or a newline`

scopelint is replaced by exportloopref (already endabled)
interfacer has no replacement but I do not think this linter is
important.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
---
 pkg/api/handlers/compat/containers_archive.go | 3 +--
 pkg/api/handlers/libpod/containers_create.go  | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

(limited to 'pkg/api')

diff --git a/pkg/api/handlers/compat/containers_archive.go b/pkg/api/handlers/compat/containers_archive.go
index f2ff4d100..45b13818b 100644
--- a/pkg/api/handlers/compat/containers_archive.go
+++ b/pkg/api/handlers/compat/containers_archive.go
@@ -2,7 +2,6 @@ package compat
 
 import (
 	"encoding/json"
-	"fmt"
 	"net/http"
 	"os"
 
@@ -28,7 +27,7 @@ func Archive(w http.ResponseWriter, r *http.Request) {
 	case http.MethodHead, http.MethodGet:
 		handleHeadAndGet(w, r, decoder, runtime)
 	default:
-		utils.Error(w, http.StatusNotImplemented, errors.New(fmt.Sprintf("unsupported method: %v", r.Method)))
+		utils.Error(w, http.StatusNotImplemented, errors.Errorf("unsupported method: %v", r.Method))
 	}
 }
 
diff --git a/pkg/api/handlers/libpod/containers_create.go b/pkg/api/handlers/libpod/containers_create.go
index 1043dec4d..4fff9e345 100644
--- a/pkg/api/handlers/libpod/containers_create.go
+++ b/pkg/api/handlers/libpod/containers_create.go
@@ -45,7 +45,7 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
 	// need to check for memory limit to adjust swap
 	if sg.ResourceLimits != nil && sg.ResourceLimits.Memory != nil {
 		s := ""
-		var l int64 = 0
+		var l int64
 		if sg.ResourceLimits.Memory.Swap != nil {
 			s = strconv.Itoa(int(*sg.ResourceLimits.Memory.Swap))
 		}
-- 
cgit v1.2.3-54-g00ecf