Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkg/action/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,13 @@ func Diff(ctx context.Context, c malcontent.Config, _ *clog.Logger) (*malcontent
if err != nil {
return nil, err
}
defer srcFile.Close()

st, err := srcFile.Stat()
if err != nil {
return nil, err
}

defer srcFile.Close()

// create a buffer sized to the minimum of the file's size or the default ReadBuffer
// only do so if we actually need to retrieve the file's contents
buf := readPool.Get(min(st.Size(), file.ReadBuffer)) //nolint:nilaway // the buffer pool is created above
Expand Down