Refactor newClient in ctr

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-10-23 13:38:15 -04:00
parent edf4114d55
commit 9f76083a8f
30 changed files with 299 additions and 450 deletions

View File

@@ -31,16 +31,12 @@ var tasksCommand = cli.Command{
taskDeleteCommand,
},
Action: func(context *cli.Context) error {
var (
quiet = context.Bool("quiet")
ctx, cancel = appContext(context)
)
defer cancel()
client, err := newClient(context)
quiet := context.Bool("quiet")
client, ctx, cancel, err := newClient(context)
if err != nil {
return err
}
defer cancel()
s := client.TaskService()
response, err := s.List(ctx, &tasks.ListTasksRequest{})
if err != nil {