From 42334c102f068a15aadee02e25d025a2e68a4101 Mon Sep 17 00:00:00 2001 From: Michal Biesek Date: Mon, 14 Aug 2023 17:39:09 +0200 Subject: [PATCH] go-selinux: fix `if-return` in Relabel Ref: https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return Signed-off-by: Michal Biesek --- go-selinux/label/label_linux.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/go-selinux/label/label_linux.go b/go-selinux/label/label_linux.go index f61a560..e49e6d5 100644 --- a/go-selinux/label/label_linux.go +++ b/go-selinux/label/label_linux.go @@ -120,10 +120,7 @@ func Relabel(path string, fileLabel string, shared bool) error { c["level"] = "s0" fileLabel = c.Get() } - if err := selinux.Chcon(path, fileLabel, true); err != nil { - return err - } - return nil + return selinux.Chcon(path, fileLabel, true) } // DisableSecOpt returns a security opt that can disable labeling