File tree Expand file tree Collapse file tree 3 files changed +10
-23
lines changed
Expand file tree Collapse file tree 3 files changed +10
-23
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,10 @@ func createHandle(context *cli.Context) error {
3939 return fmt .Errorf ("both src and dest must be provided" )
4040 }
4141
42- var v bundleCmd
43- if context .IsSet ("type" ) {
44- v .typ = context .String ("type" )
45- }
46- if context .IsSet ("ref" ) {
47- v .ref = context .String ("ref" )
48- }
49- if context .IsSet ("rootfs" ) {
50- v .root = context .String ("rootfs" )
51- } else {
52- v .root = "rootfs"
42+ v := bundleCmd {
43+ typ : context .String ("type" ),
44+ ref : context .String ("ref" ),
45+ root : context .String ("rootfs" ),
5346 }
5447
5548 if v .typ == "" {
Original file line number Diff line number Diff line change @@ -38,12 +38,9 @@ func unpackHandle(context *cli.Context) error {
3838 return fmt .Errorf ("both src and dest must be provided" )
3939 }
4040
41- var v unpackCmd
42- if context .IsSet ("type" ) {
43- v .typ = context .String ("type" )
44- }
45- if context .IsSet ("ref" ) {
46- v .ref = context .String ("ref" )
41+ v := unpackCmd {
42+ typ : context .String ("type" ),
43+ ref : context .String ("ref" ),
4744 }
4845
4946 if v .typ == "" {
Original file line number Diff line number Diff line change @@ -48,12 +48,9 @@ func validateHandler(context *cli.Context) error {
4848 return fmt .Errorf ("no files specified" )
4949 }
5050
51- if context .IsSet ("type" ) {
52- v .typ = context .String ("type" )
53- }
54-
55- if context .IsSet ("ref" ) {
56- v .refs = context .StringSlice ("ref" )
51+ v = validateCmd {
52+ typ : context .String ("type" ),
53+ refs : context .StringSlice ("ref" ),
5754 }
5855
5956 var errs []string
You can’t perform that action at this time.
0 commit comments