From 4fc2839847c9115d8e4237be9f8fe4abb8c36354 Mon Sep 17 00:00:00 2001 From: FantasyRL <1845983502@qq.com> Date: Tue, 12 Nov 2024 22:13:58 +0800 Subject: [PATCH] fix:go.mod --- go.mod | 2 +- pkg/utils/utils.go | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 887cc8f..73e7062 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( k8s.io/client-go v0.31.2 ) -require github.com/h2non/filetype v1.1.3 // indirect +require github.com/h2non/filetype v1.1.3 require ( cloud.google.com/go v0.116.0 // indirect diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 0d1dd15..eaaf06b 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -205,11 +205,7 @@ func IsAllowImageFile(header *multipart.FileHeader) (string, bool) { return "", false } - // 使用filetype包判断文件类型 - kind, err := filetype.Match(buffer) - if err != nil { - return "", false - } + kind, _ := filetype.Match(buffer) // 检查是否为jpg、png switch kind {