From a19447aed128ecadfcd938d6a80cd4951af1f4ce Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 25 Dec 2020 09:59:32 +0000 Subject: 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 --- cmd/serv.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmd') 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 { -- cgit v1.2.3