Skip to content

Commit

Permalink
Fix error handling and add nolint comment
Browse files Browse the repository at this point in the history
  • Loading branch information
belimawr committed Oct 16, 2024
1 parent e2815a4 commit c97ee8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions filebeat/input/systemlogs/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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

Check failure on line 162 in filebeat/input/systemlogs/input.go

View workflow job for this annotation

GitHub Actions / lint (linux)

directive `// nolint:unused // It's used on Linux` should be written without leading space as `//nolint:unused // It's used on Linux` (nolintlint)
newCfg, err := cfg.Child("journald", -1)
if err != nil {
return nil, fmt.Errorf("cannot extract 'journald' block: %w", err)
Expand Down

0 comments on commit c97ee8e

Please sign in to comment.