From 1e708d2a96e0c7a955e66998765f03085fb37f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E7=8E=AE=E6=96=87?= Date: Sun, 7 Dec 2025 15:22:12 +0800 Subject: [PATCH] unit: simplify escape character --- unit/escape.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit/escape.go b/unit/escape.go index 98e2044a..df9c8cc1 100644 --- a/unit/escape.go +++ b/unit/escape.go @@ -57,7 +57,7 @@ func escape(unescaped string, isPath bool) string { if c == '/' { e = append(e, '-') } else if start && c == '.' || strings.IndexByte(allowed, c) == -1 { - e = append(e, []byte(fmt.Sprintf(`\x%x`, c))...) + e = fmt.Appendf(e, `\x%x`, c) } else { e = append(e, c) }