mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user