From 8d1c755dd1cd419f363e5706638c3275d2b6c4fa Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Mon, 9 Oct 2023 12:13:06 +0200 Subject: [PATCH] misc: remove unnecessary use of fmt.Sprintf Signed-off-by: Hidde Beydals --- internal/controller/bucket_controller_test.go | 4 ++-- internal/controller/gitrepository_controller.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/controller/bucket_controller_test.go b/internal/controller/bucket_controller_test.go index ff7b33f6..f0858335 100644 --- a/internal/controller/bucket_controller_test.go +++ b/internal/controller/bucket_controller_test.go @@ -258,7 +258,7 @@ func TestBucketReconciler_reconcileStorage(t *testing.T) { name: "notices missing artifact in storage", beforeFunc: func(obj *bucketv1.Bucket, storage *Storage) error { obj.Status.Artifact = &sourcev1.Artifact{ - Path: fmt.Sprintf("/reconcile-storage/invalid.txt"), + Path: "/reconcile-storage/invalid.txt", Revision: "d", } storage.SetArtifactURL(obj.Status.Artifact) @@ -339,7 +339,7 @@ func TestBucketReconciler_reconcileStorage(t *testing.T) { name: "updates hostname on diff from current", beforeFunc: func(obj *bucketv1.Bucket, storage *Storage) error { obj.Status.Artifact = &sourcev1.Artifact{ - Path: fmt.Sprintf("/reconcile-storage/hostname.txt"), + Path: "/reconcile-storage/hostname.txt", Revision: "f", Digest: "sha256:3b9c358f36f0a31b6ad3e14f309c7cf198ac9246e8316f9ce543d5b19ac02b80", URL: "http://outdated.com/reconcile-storage/hostname.txt", diff --git a/internal/controller/gitrepository_controller.go b/internal/controller/gitrepository_controller.go index 60736b95..35eb5f69 100644 --- a/internal/controller/gitrepository_controller.go +++ b/internal/controller/gitrepository_controller.go @@ -521,7 +521,7 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context, sp *patch // Observe if the artifacts still match the previous included ones if artifacts.Diff(obj.Status.IncludedArtifacts) { - message := fmt.Sprintf("included artifacts differ from last observed includes") + message := "included artifacts differ from last observed includes" if obj.Status.IncludedArtifacts != nil { conditions.MarkTrue(obj, sourcev1.ArtifactOutdatedCondition, "IncludeChange", message) }