From ff8a3470c74b1b4de36e9d3b38e53513925466bd Mon Sep 17 00:00:00 2001 From: starainrt Date: Sat, 2 Nov 2024 19:59:36 +0800 Subject: [PATCH] bug fix --- httpserver/cmd.go | 2 +- keygen/keygen.go | 2 +- main.go | 2 +- mget/cmd.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/httpserver/cmd.go b/httpserver/cmd.go index 88b413b..354b748 100644 --- a/httpserver/cmd.go +++ b/httpserver/cmd.go @@ -52,7 +52,7 @@ func init() { } func parseSpeedString(speedString string) (uint64, error) { // 定义单位及其对应的字节值 - unitMultipliers := map[string]int{ + unitMultipliers := map[string]int64{ "b": 1, "": 1, "k": 1024, "kb": 1024, "kib": 1024, "m": 1024 * 1024, "mb": 1024 * 1024, "mib": 1024 * 1024, diff --git a/keygen/keygen.go b/keygen/keygen.go index d0ea7c0..7434a3c 100644 --- a/keygen/keygen.go +++ b/keygen/keygen.go @@ -106,7 +106,7 @@ func (k *KeyGen) Gen() error { return err } var block *pem.Block - if k.Encrypt != "" { + if k.Encrypt == "" { block, err = ssh.MarshalPrivateKey(priv, "") } else { block, err = ssh.MarshalPrivateKeyWithPassphrase(priv, "", []byte(k.Encrypt)) diff --git a/main.go b/main.go index c984379..c9fb03b 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,7 @@ import ( var cmdRoot = &cobra.Command{ Use: "b612", - Version: "2.1.0.beta.11", + Version: "2.1.0.beta.12", } func init() { diff --git a/mget/cmd.go b/mget/cmd.go index 6e2288c..5baf592 100644 --- a/mget/cmd.go +++ b/mget/cmd.go @@ -42,7 +42,7 @@ func init() { func parseSpeedString(speedString string) (uint64, error) { // 定义单位及其对应的字节值 - unitMultipliers := map[string]int{ + unitMultipliers := map[string]int64{ "b": 1, "": 1, "k": 1024, "kb": 1024, "kib": 1024, "m": 1024 * 1024, "mb": 1024 * 1024, "mib": 1024 * 1024,