From 5475b629384caf878164197c7b475f5d6c7da0ec Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 30 Mar 2020 10:31:23 +0800 Subject: [PATCH] fix version conflict of urfave/cli (#540) Co-authored-by: chenzhihui --- go.mod | 1 - go.sum | 2 -- tool/kratos-protoc/main.go | 10 +++++----- tool/kratos-protoc/protoc.go | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index c1edff070..c5976cb79 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,6 @@ require ( github.com/stretchr/testify v1.4.0 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect github.com/tsuna/gohbase v0.0.0-20190502052937-24ffed0537aa - github.com/urfave/cli v1.22.1 github.com/urfave/cli/v2 v2.1.1 go.etcd.io/etcd v0.0.0-20190917205325-a14579fbfb1a go.uber.org/atomic v1.4.0 // indirect diff --git a/go.sum b/go.sum index b991a79e0..d50f7a14e 100644 --- a/go.sum +++ b/go.sum @@ -285,8 +285,6 @@ github.com/tsuna/gohbase v0.0.0-20190502052937-24ffed0537aa/go.mod h1:3HfLQly3YN github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= diff --git a/tool/kratos-protoc/main.go b/tool/kratos-protoc/main.go index 7279b39d1..981d9857c 100644 --- a/tool/kratos-protoc/main.go +++ b/tool/kratos-protoc/main.go @@ -4,7 +4,7 @@ import ( "log" "os" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) func main() { @@ -12,22 +12,22 @@ func main() { app.Name = "protc" app.Usage = "protobuf生成工具" app.Flags = []cli.Flag{ - cli.BoolFlag{ + &cli.BoolFlag{ Name: "bm", Usage: "whether to use BM for generation", Destination: &withBM, }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "grpc", Usage: "whether to use gRPC for generation", Destination: &withGRPC, }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "swagger", Usage: "whether to use swagger for generation", Destination: &withSwagger, }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "ecode", Usage: "whether to use ecode for generation", Destination: &withEcode, diff --git a/tool/kratos-protoc/protoc.go b/tool/kratos-protoc/protoc.go index 7cbf3d807..9ecf03167 100644 --- a/tool/kratos-protoc/protoc.go +++ b/tool/kratos-protoc/protoc.go @@ -13,7 +13,7 @@ import ( "runtime" "strings" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) var ( @@ -27,7 +27,7 @@ func protocAction(ctx *cli.Context) (err error) { if err = checkProtoc(); err != nil { return err } - files := []string(ctx.Args()) + files := ctx.Args().Slice() if len(files) == 0 { files, _ = filepath.Glob("*.proto") }