Skip to content

Commit

Permalink
txtar: return the result of slices.Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
Stavrospanakakis committed Sep 17, 2024
1 parent 0441413 commit 468e405
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions txtar/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ func (fsys *filesystem) ReadFile(name string) ([]byte, error) {
return nil, err
}
if file, ok := file.(*openFile); ok {
cp := slices.Clone(file.data)
return cp, err
return slices.Clone(file.data), nil
}
return nil, &fs.PathError{Op: "read", Path: name, Err: fs.ErrInvalid}
}
Expand Down

0 comments on commit 468e405

Please sign in to comment.