Lint: Fix violations of S1009: should omit nil check; len() for nil slices is defined as zero (#14973)

* Fix violations of S1009: should omit nil check; len() for nil slices is defined as zero

* Changelog fragment
This commit is contained in:
Preston Van Loon
2025-02-21 13:39:33 -06:00
committed by GitHub
parent 8345c271cc
commit 832ebb3f39
6 changed files with 8 additions and 5 deletions

View File

@@ -291,7 +291,7 @@ func (*Server) ValidateKeystores(w http.ResponseWriter, r *http.Request) {
return
}
// Needs to unmarshal the keystores from the requests.
if req.Keystores == nil || len(req.Keystores) < 1 {
if len(req.Keystores) < 1 {
httputil.HandleError(w, "No keystores included in request", http.StatusBadRequest)
return
}

View File

@@ -131,7 +131,7 @@ func (s *Server) BackupAccounts(w http.ResponseWriter, r *http.Request) {
return
}
if req.PublicKeys == nil || len(req.PublicKeys) < 1 {
if len(req.PublicKeys) < 1 {
httputil.HandleError(w, "No public keys specified to backup", http.StatusBadRequest)
return
}