Add staticcheck to console API (#2883)

This commit is contained in:
Javier Adriel
2023-06-14 21:35:00 -06:00
committed by GitHub
parent 559a7278a0
commit d49bdf7d49
24 changed files with 78 additions and 109 deletions

View File

@@ -304,11 +304,11 @@ func importConfigResponse(session *models.Principal, params cfgApi.PostConfigsIm
return nil, ErrorWithContext(ctx, err)
}
file, _, err := params.HTTPRequest.FormFile("file")
defer file.Close()
if err != nil {
return nil, ErrorWithContext(ctx, err)
}
defer file.Close()
err = mAdmin.SetConfig(ctx, file)
if err != nil {
return nil, ErrorWithContext(ctx, err)