update micro/cli to urfave/cli/v2 and fix go-micro

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-01-25 13:41:25 +03:00
parent 1d00f2f771
commit e6a34bcbe7
14 changed files with 183 additions and 176 deletions

View File

@@ -5,9 +5,9 @@ import (
"os"
"testing"
"github.com/micro/cli"
"github.com/micro/go-micro/config/cmd"
"github.com/micro/go-micro/config/source"
"github.com/micro/cli/v2"
)
func test(t *testing.T, withContext bool) {
@@ -17,14 +17,15 @@ func test(t *testing.T, withContext bool) {
app := cmd.App()
app.Name = "testapp"
app.Flags = []cli.Flag{
cli.StringFlag{Name: "db-host"},
&cli.StringFlag{Name: "db-host"},
}
// with context
if withContext {
// set action
app.Action = func(c *cli.Context) {
app.Action = func(c *cli.Context) error {
src = WithContext(c)
return nil
}
// run app