summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-04-22 13:38:41 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-04-22 15:12:33 +0200
commit5b4af0584d1c66b4f8d3d721374541fb76b5b395 (patch)
tree0c3a0aa6323ed1a0998784476bfe24c126da5e3a /libpod
parent22500d797aba09eada894a69ad88f2699a560d02 (diff)
downloadpodman-5b4af0584d1c66b4f8d3d721374541fb76b5b395.tar.gz
podman-5b4af0584d1c66b4f8d3d721374541fb76b5b395.tar.bz2
podman-5b4af0584d1c66b4f8d3d721374541fb76b5b395.zip
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>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_exec.go4
-rw-r--r--libpod/container_internal.go2
-rw-r--r--libpod/container_internal_linux.go2
-rw-r--r--libpod/kube.go2
-rw-r--r--libpod/lock/in_memory_locks.go2
5 files changed, 6 insertions, 6 deletions
diff --git a/libpod/container_exec.go b/libpod/container_exec.go
index 140267f28..d782bebf8 100644
--- a/libpod/container_exec.go
+++ b/libpod/container_exec.go
@@ -79,11 +79,11 @@ type ExecConfig struct {
type ExecSession struct {
// Id is the ID of the exec session.
// Named somewhat strangely to not conflict with ID().
- // nolint:stylecheck,golint
+ // nolint:stylecheck,revive
Id string `json:"id"`
// ContainerId is the ID of the container this exec session belongs to.
// Named somewhat strangely to not conflict with ContainerID().
- // nolint:stylecheck,golint
+ // nolint:stylecheck,revive
ContainerId string `json:"containerId"`
// State is the state of the exec session.
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index b051b7f2d..9449d31c7 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -264,7 +264,7 @@ func (c *Container) handleRestartPolicy(ctx context.Context) (_ bool, retErr err
if c.ensureState(define.ContainerStateRunning, define.ContainerStatePaused) {
return false, nil
} else if c.state.State == define.ContainerStateUnknown {
- return false, errors.Wrapf(define.ErrInternal, "invalid container state encountered in restart attempt!")
+ return false, errors.Wrapf(define.ErrInternal, "invalid container state encountered in restart attempt")
}
c.newContainerEvent(events.Restart)
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 6ffd99649..b5f8ad8e8 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -3220,7 +3220,7 @@ func (c *Container) getOCICgroupPath() (string, error) {
}
func (c *Container) copyTimezoneFile(zonePath string) (string, error) {
- var localtimeCopy string = filepath.Join(c.state.RunDir, "localtime")
+ localtimeCopy := filepath.Join(c.state.RunDir, "localtime")
file, err := os.Stat(zonePath)
if err != nil {
return "", err
diff --git a/libpod/kube.go b/libpod/kube.go
index 22fbb5f9f..5e5260dd5 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -213,7 +213,7 @@ type YAMLContainer struct {
func ConvertV1PodToYAMLPod(pod *v1.Pod) *YAMLPod {
cs := []*YAMLContainer{}
for _, cc := range pod.Spec.Containers {
- var res *v1.ResourceRequirements = nil
+ var res *v1.ResourceRequirements
if len(cc.Resources.Limits) > 0 || len(cc.Resources.Requests) > 0 {
res = &cc.Resources
}
diff --git a/libpod/lock/in_memory_locks.go b/libpod/lock/in_memory_locks.go
index f3c842f89..f7f47760c 100644
--- a/libpod/lock/in_memory_locks.go
+++ b/libpod/lock/in_memory_locks.go
@@ -49,7 +49,7 @@ type InMemoryManager struct {
// of locks.
func NewInMemoryManager(numLocks uint32) (Manager, error) {
if numLocks == 0 {
- return nil, errors.Errorf("must provide a non-zero number of locks!")
+ return nil, errors.Errorf("must provide a non-zero number of locks")
}
manager := new(InMemoryManager)