Introduce staticcheck for stricter builds (#7035)

This commit is contained in:
Harshavardhana
2019-02-13 04:59:36 -08:00
committed by Nitish Tiwari
parent 4ba77a916d
commit df35d7db9d
71 changed files with 274 additions and 777 deletions

View File

@@ -381,7 +381,6 @@ func (a adminAPIHandlers) PerfInfoHandler(w http.ResponseWriter, r *http.Request
} else {
writeErrorResponseJSON(w, errorCodes.ToAPIErr(ErrMethodNotAllowed), r.URL)
}
return
}
func newLockEntry(l lockRequesterInfo, resource, server string) *madmin.LockEntry {
@@ -437,12 +436,20 @@ func (a adminAPIHandlers) TopLocksHandler(w http.ResponseWriter, r *http.Request
return
}
// Method only allowed in XL mode.
// Method only allowed in Distributed XL mode.
if !globalIsDistXL {
writeErrorResponseJSON(w, errorCodes.ToAPIErr(ErrMethodNotAllowed), r.URL)
return
}
// Authenticate request
// Setting the region as empty so as the mc server info command is irrespective to the region.
adminAPIErr := checkAdminRequestAuthType(ctx, r, "")
if adminAPIErr != ErrNone {
writeErrorResponseJSON(w, errorCodes.ToAPIErr(adminAPIErr), r.URL)
return
}
thisAddr, err := xnet.ParseHost(GetLocalPeer(globalEndpoints))
if err != nil {
writeErrorResponseJSON(w, toAdminAPIErr(ctx, err), r.URL)