From 89b688424a3121c7add6cd3616762fc1ed8f9273 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 17 Jul 2026 10:57:45 +0000 Subject: [PATCH] fix: rename min function to avoid conflict with builtin --- internal/captcha/handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/captcha/handler.go b/internal/captcha/handler.go index 713ef04..818af57 100644 --- a/internal/captcha/handler.go +++ b/internal/captcha/handler.go @@ -330,7 +330,7 @@ func preprocessMath(img image.Image) ([]float32, error) { // 计算缩放比例 bounds := img.Bounds() srcW, srcH := bounds.Dx(), bounds.Dy() - ratio := min(float64(targetW)/float64(srcW), float64(targetH)/float64(srcH)) + ratio := minFloat(float64(targetW)/float64(srcW), float64(targetH)/float64(srcH)) newW := int(float64(srcW) * ratio) newH := int(float64(srcH) * ratio) @@ -464,7 +464,7 @@ func decodeMath(output []float32, outputShape []int64) string { return result } -func min(a, b float64) float64 { +func minFloat(a, b float64) float64 { if a < b { return a }