From ff9988ff7c8f2caf3fa468a61b923f7dec53e874 Mon Sep 17 00:00:00 2001 From: Alan Parra Date: Wed, 3 Jul 2024 20:12:02 -0300 Subject: [PATCH] Address staticcheck false positives (#43800) --- lib/srv/usermgmt.go | 2 ++ lib/srv/usermgmt_other.go | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/srv/usermgmt.go b/lib/srv/usermgmt.go index d8ce41205908f..5dd3558810ec0 100644 --- a/lib/srv/usermgmt.go +++ b/lib/srv/usermgmt.go @@ -319,7 +319,9 @@ func (u *HostUserManagement) UpsertUser(name string, ui *services.HostUsersInfo) var home string if ui.Mode != types.CreateHostUserMode_HOST_USER_MODE_INSECURE_DROP { + //nolint:staticcheck // SA4023. False positive on macOS. home, err = readDefaultHome(name) + //nolint:staticcheck // SA4023. False positive on macOS. if err != nil { return nil, trace.Wrap(err) } diff --git a/lib/srv/usermgmt_other.go b/lib/srv/usermgmt_other.go index b2615b821388b..66bb293a75ae5 100644 --- a/lib/srv/usermgmt_other.go +++ b/lib/srv/usermgmt_other.go @@ -35,6 +35,7 @@ func newHostSudoersBackend(_ string) (HostSudoersBackend, error) { return nil, trace.NotImplemented("Host user creation management is only supported on linux") } +//nolint:staticcheck // intended to always return an error for non-linux builds func readDefaultHome(user string) (string, error) { return "", trace.NotImplemented("readDefaultHome is only supported on linux") }