From c97ee8e9ad9e543078736e45eb13164b3355a5d0 Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Wed, 16 Oct 2024 08:28:45 -0400 Subject: [PATCH 1/2] Fix error handling and add nolint comment --- filebeat/input/systemlogs/input.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filebeat/input/systemlogs/input.go b/filebeat/input/systemlogs/input.go index 05cd541d81c1..9fe402e46d96 100644 --- a/filebeat/input/systemlogs/input.go +++ b/filebeat/input/systemlogs/input.go @@ -119,7 +119,7 @@ func useJournald(c *conf.C) (bool, error) { cfg := config{} if err := c.Unpack(&cfg); err != nil { - return false, nil + return false, fmt.Errorf("cannot unpack 'system-logs' config: %w", err) } if cfg.UseJournald { @@ -159,7 +159,7 @@ func useJournald(c *conf.C) (bool, error) { return true, nil } -func toJournaldConfig(cfg *conf.C) (*conf.C, error) { +func toJournaldConfig(cfg *conf.C) (*conf.C, error) { // nolint:unused // It's used on Linux newCfg, err := cfg.Child("journald", -1) if err != nil { return nil, fmt.Errorf("cannot extract 'journald' block: %w", err) From aa0dd0e66d23f5de6c4938fa3cdb402d9d97b381 Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Wed, 16 Oct 2024 08:43:23 -0400 Subject: [PATCH 2/2] Update filebeat/input/systemlogs/input.go Co-authored-by: Denis --- filebeat/input/systemlogs/input.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filebeat/input/systemlogs/input.go b/filebeat/input/systemlogs/input.go index 9fe402e46d96..7badfda760cf 100644 --- a/filebeat/input/systemlogs/input.go +++ b/filebeat/input/systemlogs/input.go @@ -159,7 +159,7 @@ func useJournald(c *conf.C) (bool, error) { return true, nil } -func toJournaldConfig(cfg *conf.C) (*conf.C, error) { // nolint:unused // It's used on Linux +func toJournaldConfig(cfg *conf.C) (*conf.C, error) { //nolint:unused // It's used on Linux newCfg, err := cfg.Child("journald", -1) if err != nil { return nil, fmt.Errorf("cannot extract 'journald' block: %w", err)