summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-25 09:59:32 +0000
committerGitHub <noreply@github.com>2020-12-25 11:59:32 +0200
commita19447aed128ecadfcd938d6a80cd4951af1f4ce (patch)
tree6312bf946d601aab29731645a4777feeaea66036 /cmd
parent04ae0f2f3f4556c6d0b4adc5f2cffd0cc7d25151 (diff)
downloadgitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.tar.gz
gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.zip
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
Diffstat (limited to 'cmd')
-rw-r--r--cmd/serv.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/serv.go b/cmd/serv.go
index 1b41a5a078..fb1e581134 100644
--- a/cmd/serv.go
+++ b/cmd/serv.go
@@ -26,7 +26,6 @@ import (
"github.com/dgrijalva/jwt-go"
"github.com/kballard/go-shellquote"
- "github.com/unknwon/com"
"github.com/urfave/cli"
)
@@ -105,7 +104,10 @@ func runServ(c *cli.Context) error {
if len(keys) != 2 || keys[0] != "key" {
fail("Key ID format error", "Invalid key argument: %s", c.Args()[0])
}
- keyID := com.StrTo(keys[1]).MustInt64()
+ keyID, err := strconv.ParseInt(keys[1], 10, 64)
+ if err != nil {
+ fail("Key ID format error", "Invalid key argument: %s", c.Args()[1])
+ }
cmd := os.Getenv("SSH_ORIGINAL_COMMAND")
if len(cmd) == 0 {