Skip to content

Commit

Permalink
go-selinux: fix if-return in Relabel
Browse files Browse the repository at this point in the history
Ref: https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return

Signed-off-by: Michal Biesek <michalbiesek@gmail.com>
  • Loading branch information
michalbiesek committed Aug 14, 2023
1 parent d47b9f7 commit 42334c1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions go-selinux/label/label_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 42334c1

Please sign in to comment.