Skip to content

Commit 0e7e9c4

Browse files
knopers8justonedev1
authored andcommitted
[core] fix incorrect Sprintf usage in CCDB plugin
1 parent 37c81be commit 0e7e9c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/integration/ccdb/plugin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,12 @@ func (p *Plugin) uploadCurrentGRP(grp *GeneralRunParameters, envId string, refre
536536
strings.Join(grp.detectors, ","), strings.Join(grp.triggeringDetectors, ","), strings.Join(grp.continuousReadoutDetectors, ","))
537537
cmdStr, err := p.NewCcdbGrpWriteCommand(grp, p.ccdbUrl, refresh)
538538
if err != nil {
539-
return errors.New(fmt.Sprintf("Failed to build a GRP to CCDB upload command: " + err.Error()))
539+
return errors.New("Failed to build a GRP to CCDB upload command: " + err.Error())
540540
}
541541
log.WithField("partition", envId).
542542
WithField("run", grp.runNumber).
543543
WithField("level", infologger.IL_Devel).
544-
Debug(fmt.Sprintf("CCDB GRP upload command: '" + cmdStr + "'"))
544+
Debugf("CCDB GRP upload command: '%s'", cmdStr)
545545

546546
const timeoutSeconds = 10
547547
ctx, cancel := context.WithTimeout(context.Background(), timeoutSeconds*time.Second)
@@ -555,10 +555,10 @@ func (p *Plugin) uploadCurrentGRP(grp *GeneralRunParameters, envId string, refre
555555
WithField("run", grp.runNumber).
556556
Debug("CCDB GRP upload command out: " + string(cmdOut))
557557
if ctx.Err() == context.DeadlineExceeded {
558-
return errors.New(fmt.Sprintf("The command to upload GRP to CCDB timed out (" + strconv.Itoa(timeoutSeconds) + "s)."))
558+
return errors.New("The command to upload GRP to CCDB timed out (" + strconv.Itoa(timeoutSeconds) + "s).")
559559
}
560560
if err != nil {
561-
return errors.New(fmt.Sprintf("Failed to run the command to upload GRP to CCDB: " + err.Error() + "\ncommand out : " + string(cmdOut)))
561+
return errors.New("Failed to run the command to upload GRP to CCDB: " + err.Error() + "\ncommand out : " + string(cmdOut))
562562
}
563563
return nil
564564
}

0 commit comments

Comments
 (0)