remove multierr
This commit is contained in:
parent
9319fec6f8
commit
8ace5844f6
@ -8,7 +8,6 @@ go_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//src/undocker/lxcconfig:go_default_library",
|
"//src/undocker/lxcconfig:go_default_library",
|
||||||
"@com_github_jessevdk_go_flags//:go_default_library",
|
"@com_github_jessevdk_go_flags//:go_default_library",
|
||||||
"@org_uber_go_multierr//:go_default_library",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
goflags "github.com/jessevdk/go-flags"
|
goflags "github.com/jessevdk/go-flags"
|
||||||
"github.com/motiejus/code/undocker/lxcconfig"
|
"github.com/motiejus/code/undocker/lxcconfig"
|
||||||
"go.uber.org/multierr"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const _description = "Create an LXC-compatible container configuration"
|
const _description = "Create an LXC-compatible container configuration"
|
||||||
@ -46,7 +45,12 @@ func (c *Command) Execute(args []string) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer func() { err = multierr.Append(err, rd.Close()) }()
|
defer func() {
|
||||||
|
err1 := rd.Close()
|
||||||
|
if err == nil {
|
||||||
|
err = err1
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
var out io.Writer
|
var out io.Writer
|
||||||
outf := string(c.PositionalArgs.Outfile)
|
outf := string(c.PositionalArgs.Outfile)
|
||||||
@ -57,7 +61,12 @@ func (c *Command) Execute(args []string) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("create: %w", err)
|
return fmt.Errorf("create: %w", err)
|
||||||
}
|
}
|
||||||
defer func() { err = multierr.Append(err, outf.Close()) }()
|
defer func() {
|
||||||
|
err1 := outf.Close()
|
||||||
|
if err == nil {
|
||||||
|
err = err1
|
||||||
|
}
|
||||||
|
}()
|
||||||
out = outf
|
out = outf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ go_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//src/undocker/rootfs:go_default_library",
|
"//src/undocker/rootfs:go_default_library",
|
||||||
"@com_github_jessevdk_go_flags//:go_default_library",
|
"@com_github_jessevdk_go_flags//:go_default_library",
|
||||||
"@org_uber_go_multierr//:go_default_library",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
goflags "github.com/jessevdk/go-flags"
|
goflags "github.com/jessevdk/go-flags"
|
||||||
"github.com/motiejus/code/undocker/rootfs"
|
"github.com/motiejus/code/undocker/rootfs"
|
||||||
"go.uber.org/multierr"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const _description = "Flatten a docker container image to a tarball"
|
const _description = "Flatten a docker container image to a tarball"
|
||||||
@ -46,7 +45,12 @@ func (c *Command) Execute(args []string) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer func() { err = multierr.Append(err, rd.Close()) }()
|
defer func() {
|
||||||
|
err1 := rd.Close()
|
||||||
|
if err == nil {
|
||||||
|
err = err1
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
var out io.Writer
|
var out io.Writer
|
||||||
if fname := string(c.PositionalArgs.Outfile); fname == "-" {
|
if fname := string(c.PositionalArgs.Outfile); fname == "-" {
|
||||||
@ -56,7 +60,12 @@ func (c *Command) Execute(args []string) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("create: %w", err)
|
return fmt.Errorf("create: %w", err)
|
||||||
}
|
}
|
||||||
defer func() { err = multierr.Append(err, outf.Close()) }()
|
defer func() {
|
||||||
|
err1 = outf.Close()
|
||||||
|
if err == nil {
|
||||||
|
err = err1
|
||||||
|
}
|
||||||
|
}()
|
||||||
out = outf
|
out = outf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user