From 31be948f68b746257974e12d3af7624fa806e35f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 05 Apr 2025 13:42:14 +0800 Subject: [PATCH] HTTP: Avoid an sprintf --- http_handle_repo_raw.go | 2 +- http_handle_repo_tree.go | 2 +- diff --git a/http_handle_repo_raw.go b/http_handle_repo_raw.go index 5928f8c284d3df29fbfc32c10151c7bbc518d932..e6e8c9a6a5c88b9ae788eab053a35fe7288282b8 100644 --- a/http_handle_repo_raw.go +++ b/http_handle_repo_raw.go @@ -130,7 +130,7 @@ errorPage500(writer, params, fmt.Sprintf("unknown object kind: %d", kind)) } case 3: - errorPage500(writer, params, fmt.Sprintf("path not found: %s", pathSpec)) + errorPage500(writer, params, "path not found: "+pathSpec) default: errorPage500(writer, params, fmt.Sprintf("unknown status code: %d", status)) diff --git a/http_handle_repo_tree.go b/http_handle_repo_tree.go index 24595809cd9c07a05678f85a80babf397a393df0..f6729e9d364764d0b1d9b24ae1a1c2cf36420669 100644 --- a/http_handle_repo_tree.go +++ b/http_handle_repo_tree.go @@ -126,7 +126,7 @@ return } case 3: - errorPage500(writer, params, fmt.Sprintf("path not found: %s", pathSpec)) + errorPage500(writer, params, "path not found: "+pathSpec) return default: -- 2.48.1