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:
@@ -56,21 +56,21 @@ var pruneReferencesCommand = &cli.Command{
|
||||
Name: "references",
|
||||
Usage: "Prunes preference labels from the content store (layers only by default)",
|
||||
Flags: pruneFlags,
|
||||
Action: func(clicontext *cli.Context) error {
|
||||
client, ctx, cancel, err := commands.NewClient(clicontext)
|
||||
Action: func(cliContext *cli.Context) error {
|
||||
client, ctx, cancel, err := commands.NewClient(cliContext)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer cancel()
|
||||
|
||||
dryRun := clicontext.Bool("dry")
|
||||
dryRun := cliContext.Bool("dry")
|
||||
if dryRun {
|
||||
log.G(ctx).Logger.SetLevel(log.DebugLevel)
|
||||
log.G(ctx).Debug("dry run, no changes will be applied")
|
||||
}
|
||||
|
||||
var deleteOpts []leases.DeleteOpt
|
||||
if !clicontext.Bool("async") {
|
||||
if !cliContext.Bool("async") {
|
||||
deleteOpts = append(deleteOpts, leases.SynchronousDelete)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user