Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Dasha Komsa <[email protected]>
  • Loading branch information
d-honeybadger committed Feb 15, 2024
1 parent ebfecf4 commit 3cc691a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/ansible/ansible.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,9 @@ func parseEvents(dir string) ([]jobEvent, error) {
return nil, fmt.Errorf("reading job events directory: %w", err)
}

var evts []jobEvent
for _, file := range files {
evtBytes, err := os.ReadFile(filepath.Join(dir, file.Name()))
evts := make([]jobEvent, len(files))
for i, file := range files {
evtBytes, err := os.ReadFile(filepath.Clean(filepath.Join(dir, file.Name())))
if err != nil {
return nil, fmt.Errorf("reading job event file %q: %w", file.Name(), err)
}
Expand All @@ -442,7 +442,7 @@ func parseEvents(dir string) ([]jobEvent, error) {
if err := json.Unmarshal(evtBytes, &evt); err != nil {
return nil, fmt.Errorf("unmarshaling job event from file %q: %w", file.Name(), err)
}
evts = append(evts, evt)
evts[i] = evt
}

return evts, nil
Expand Down

0 comments on commit 3cc691a

Please sign in to comment.