[client] Fix staticcheck findings from the updated golangci-lint (#7266)

* Fix staticcheck findings reported by the updated golangci-lint

* Skip the receive error log when the local context is done
This commit is contained in:
Viktor Liu
2026-08-20 23:50:50 +09:00
committed by GitHub
parent e206f8827d
commit e4b8bf39d2
14 changed files with 37 additions and 34 deletions

View File

@@ -75,8 +75,8 @@ func (s *Server) createCommand(logger *log.Entry, privilegeResult PrivilegeCheck
}
// Try su first for system integration (PAM/audit) when privileged
cmd, err := s.createSuCommand(logger, session, localUser, hasPty)
if err != nil || privilegeResult.UsedFallback {
cmd, err := s.createSuCommand(logger, session, localUser, hasPty) //nolint:staticcheck
if err != nil || privilegeResult.UsedFallback { //nolint:staticcheck // always errors on platforms without su
logger.Debugf("su command failed, falling back to executor: %v", err)
cmd, cleanup, err := s.createExecutorCommand(logger, session, localUser, hasPty)
if err != nil {