From d43bcc8974122faed16ac34cfe2b5da400948d3e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 16 Apr 2021 16:07:25 +0200 Subject: [PATCH] daemon/logger/journald: fix linting errors daemon/logger/journald/read.go:128:3 comment on exported function `CErr` should be of the form `CErr ...` daemon/logger/journald/read.go:131:36: unnecessary conversion (unconvert) return C.GoString(C.strerror(C.int(-ret))) ^ daemon/logger/journald/read.go:380:2: S1023: redundant `return` statement (gosimple) return ^ Signed-off-by: Sebastiaan van Stijn --- daemon/logger/journald/read.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/daemon/logger/journald/read.go b/daemon/logger/journald/read.go index d2bd112d27..76557815ab 100644 --- a/daemon/logger/journald/read.go +++ b/daemon/logger/journald/read.go @@ -125,10 +125,10 @@ func (s *journald) Close() error { return nil } -// convert error code returned from a sd_journal_* function +// CErr converts error code returned from a sd_journal_* function // (which returns -errno) to a string func CErr(ret C.int) string { - return C.GoString(C.strerror(C.int(-ret))) + return C.GoString(C.strerror(-ret)) } func (s *journald) drainJournal(logWatcher *logger.LogWatcher, j *C.sd_journal, oldCursor *C.char, untilUnixMicro uint64) (*C.char, bool, int) { @@ -377,7 +377,6 @@ func (s *journald) readLogs(logWatcher *logger.LogWatcher, config logger.ReadCon } C.free(unsafe.Pointer(cursor)) - return } func (s *journald) ReadLogs(config logger.ReadConfig) *logger.LogWatcher {