Fix go vet errors

This commit is contained in:
nemunaire 2022-07-08 23:11:11 +02:00
commit e84b1d67cb
8 changed files with 16 additions and 12 deletions

View file

@ -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
}

View file

@ -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 {

View file

@ -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
}