summaryrefslogtreecommitdiff
path: root/pkg/logs
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-11 01:22:30 +0200
committerGitHub <noreply@github.com>2019-07-11 01:22:30 +0200
commite2e8477f83f717d6a92badd317ae909cf185d04e (patch)
tree266259131bc70764b737cc65579641bd8140c533 /pkg/logs
parentdf3f5afad13c91a6f2be9e83ae328483e047c13c (diff)
parente053e0e05ecd884067125627f0006d1b6e19226e (diff)
downloadpodman-e2e8477f83f717d6a92badd317ae909cf185d04e.tar.gz
podman-e2e8477f83f717d6a92badd317ae909cf185d04e.tar.bz2
podman-e2e8477f83f717d6a92badd317ae909cf185d04e.zip
Merge pull request #3521 from baude/golangcilint1
first pass of corrections for golangci-lint
Diffstat (limited to 'pkg/logs')
-rw-r--r--pkg/logs/logs.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/logs/logs.go b/pkg/logs/logs.go
index 0f684750e..89e4e5686 100644
--- a/pkg/logs/logs.go
+++ b/pkg/logs/logs.go
@@ -30,6 +30,7 @@ import (
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/define"
+ "github.com/containers/libpod/pkg/errorhandling"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@@ -153,7 +154,7 @@ func ReadLogs(logPath string, ctr *libpod.Container, opts *LogOptions) error {
if err != nil {
return errors.Wrapf(err, "failed to open log file %q", logPath)
}
- defer file.Close()
+ defer errorhandling.CloseQuiet(file)
msg := &logMessage{}
opts.bytes = -1
@@ -161,9 +162,9 @@ func ReadLogs(logPath string, ctr *libpod.Container, opts *LogOptions) error {
reader := bufio.NewReader(file)
if opts.Follow {
- followLog(reader, writer, opts, ctr, msg, logPath)
+ err = followLog(reader, writer, opts, ctr, msg, logPath)
} else {
- dumpLog(reader, writer, opts, msg, logPath)
+ err = dumpLog(reader, writer, opts, msg, logPath)
}
return err
}