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]) -}