Skip to content

Commit

Permalink
Replace unnecessary Sprintf functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jbiers committed Feb 12, 2025
1 parent 63a912c commit fc2604f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions e2e/backup/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ const (
func formatBackupMetrics(backups []string) string {
var metrics string

rancherBackupCountHeader := fmt.Sprintf(`
rancherBackupCountHeader := fmt.Sprint(`
# HELP rancher_backup_count Number of existing Rancher Backup CRs
# TYPE rancher_backup_count gauge
`)

metrics += rancherBackupCountHeader
metrics += fmt.Sprintf("rancher_backup_count %d", len(backups))

rancherBackupsAttemptedHeader := fmt.Sprintf(`
rancherBackupsAttemptedHeader := fmt.Sprint(`
# HELP rancher_backups_attempted Number of Rancher Backups processed by this operator
# TYPE rancher_backups_attempted counter
`)
Expand All @@ -91,7 +91,7 @@ func formatBackupMetrics(backups []string) string {
}
}

rancherBackupsFailedHeader := fmt.Sprintf(`
rancherBackupsFailedHeader := fmt.Sprint(`
# HELP rancher_backups_failed Number of failed Rancher Backups processed by this operator
# TYPE rancher_backups_failed counter
`)
Expand All @@ -107,7 +107,7 @@ func formatBackupMetrics(backups []string) string {
func formatBackupMetadataMetrics(backups []backupv1.Backup) string {
var metrics string

rancherBackupHeader := fmt.Sprintf(`
rancherBackupHeader := fmt.Sprint(`
# HELP rancher_backup Details on a specific Rancher Backup CR
# TYPE rancher_backup gauge
`)
Expand Down
4 changes: 2 additions & 2 deletions e2e/backup/restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
func formatRestoreMetrics(restores []string) string {
var metrics string

rancherRestoreCountHeader := fmt.Sprintf(`
rancherRestoreCountHeader := fmt.Sprint(`
# HELP rancher_restore_count Number of existing Rancher Restore CRs
# TYPE rancher_restore_count gauge
`)
Expand All @@ -44,7 +44,7 @@ func formatRestoreMetrics(restores []string) string {
func formatRestoreMetadataMetrics(restores []backupv1.Restore) string {
var metrics string

rancherRestoreHeader := fmt.Sprintf(`
rancherRestoreHeader := fmt.Sprint(`
# HELP rancher_restore Details on a specific Rancher Restore CR
# TYPE rancher_restore gauge
`)
Expand Down

0 comments on commit fc2604f

Please sign in to comment.