Fix go vet errors
This commit is contained in:
parent
b0129e5239
commit
e84b1d67cb
8 changed files with 16 additions and 12 deletions
|
|
@ -333,7 +333,7 @@ func getTeamP12File(c *gin.Context) {
|
|||
return
|
||||
} else if fd, err := os.Open(pki.ClientP12Path(cert.Id)); err != nil {
|
||||
log.Println("Unable to open ClientP12Path:", err.Error())
|
||||
c.AbortWithError(http.StatusInternalServerError, fmt.Errorf("Unable to open the p12: %w", err.Error()))
|
||||
c.AbortWithError(http.StatusInternalServerError, fmt.Errorf("Unable to open the p12: %w", err))
|
||||
return
|
||||
} else {
|
||||
defer fd.Close()
|
||||
|
|
@ -341,7 +341,7 @@ func getTeamP12File(c *gin.Context) {
|
|||
data, err := ioutil.ReadAll(fd)
|
||||
if err != nil {
|
||||
log.Println("Unable to open ClientP12Path:", err.Error())
|
||||
c.AbortWithError(http.StatusInternalServerError, fmt.Errorf("Unable to open the p12: %w", err.Error()))
|
||||
c.AbortWithError(http.StatusInternalServerError, fmt.Errorf("Unable to open the p12: %w", err))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ func importExerciceQA(c *gin.Context) {
|
|||
} else {
|
||||
qa.Creation = uq.Creation
|
||||
qa.Solved = uq.Solved
|
||||
qa.Closed = qa.Closed
|
||||
qa.Closed = uq.Closed
|
||||
|
||||
_, err = qa.Update()
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ func deleteTeam(c *gin.Context) {
|
|||
|
||||
assocs, err := pki.GetTeamAssociations(TeamsDir, team.Id)
|
||||
if err != nil {
|
||||
log.Printf("Unable to GetTeamAssociations(tid=%s): %s", team.Id, err.Error())
|
||||
log.Printf("Unable to GetTeamAssociations(tid=%d): %s", team.Id, err.Error())
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "An error occurs when trying to retrieve team association."})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue