cmd: don't alias context package, and use cliContext for cli.Context
Unfortunately, this is a rather large diff, but perhaps worth a one-time "rip off the bandaid" for v2. This patch removes the use of "gocontext" as alias for stdLib's "context", and uses "cliContext" for uses of cli.context. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -49,13 +49,13 @@ var metricsCommand = &cli.Command{
|
||||
Value: formatTable,
|
||||
},
|
||||
},
|
||||
Action: func(context *cli.Context) error {
|
||||
client, ctx, cancel, err := commands.NewClient(context)
|
||||
Action: func(cliContext *cli.Context) error {
|
||||
client, ctx, cancel, err := commands.NewClient(cliContext)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer cancel()
|
||||
container, err := client.LoadContainer(ctx, context.Args().First())
|
||||
container, err := client.LoadContainer(ctx, cliContext.Args().First())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -83,7 +83,7 @@ var metricsCommand = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
switch context.String(formatFlag) {
|
||||
switch cliContext.String(formatFlag) {
|
||||
case formatTable:
|
||||
w := tabwriter.NewWriter(os.Stdout, 1, 8, 4, ' ', 0)
|
||||
fmt.Fprintf(w, "ID\tTIMESTAMP\t\n")
|
||||
|
Reference in New Issue
Block a user