From 48fe63511a9b9f4b1b9651cadf7cb9086a10f7d2 Mon Sep 17 00:00:00 2001 From: Lifubang Date: Wed, 5 Sep 2018 23:36:31 +0800 Subject: [PATCH] code optimization after review Signed-off-by: Lifubang --- cmd/ctr/commands/run/run_unix.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/ctr/commands/run/run_unix.go b/cmd/ctr/commands/run/run_unix.go index f968379f3..95b52a61e 100644 --- a/cmd/ctr/commands/run/run_unix.go +++ b/cmd/ctr/commands/run/run_unix.go @@ -35,9 +35,9 @@ import ( func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli.Context) (containerd.Container, error) { var ( id string - Config = context.IsSet("config") + config = context.IsSet("config") ) - if Config { + if config { id = context.Args().First() } else { id = context.Args().Get(1) @@ -57,7 +57,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli spec containerd.NewContainerOpts ) - if Config { + if config { opts = append(opts, oci.WithSpecFromFile(context.String("config"))) } else { var (