From 539f6d9ef5f485969980e82a89d119f03c5e8331 Mon Sep 17 00:00:00 2001 From: zuoban <1061669148@qq.com> Date: Fri, 18 Oct 2024 21:08:01 +0800 Subject: [PATCH] chore --- utils/utils.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/utils/utils.go b/utils/utils.go index 47806ff..6f858b5 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -6,7 +6,6 @@ import ( "crypto/sha256" "encoding/base64" "encoding/json" - "errors" "fmt" "github.com/google/uuid" "github.com/sirupsen/logrus" @@ -50,10 +49,6 @@ const ( defaultStyle = "general" ) -var ( - errEndpoint = errors.New("failed to get endpoint") -) - // GetEndpoint 获取语音合成服务的端点信息 func GetEndpoint() (map[string]interface{}, error) { signature := Sign(endpointURL) @@ -221,16 +216,3 @@ func VoiceList() ([]interface{}, error) { return result, nil } - -func ByteCountIEC(b int64) string { - const unit = 1024 - if b < unit { - return fmt.Sprintf("%d B", b) - } - div, exp := int64(unit), 0 - for n := b / unit; n >= unit; n /= unit { - div *= unit - exp++ - } - return fmt.Sprintf("%.1f %ciB", float64(b)/float64(div), "KMGTPE"[exp]) -}