Skip to content

Commit 468e405

Browse files
txtar: return the result of slices.Clone
1 parent 0441413 commit 468e405

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

txtar/fs.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ func (fsys *filesystem) ReadFile(name string) ([]byte, error) {
153153
return nil, err
154154
}
155155
if file, ok := file.(*openFile); ok {
156-
cp := slices.Clone(file.data)
157-
return cp, err
156+
return slices.Clone(file.data), nil
158157
}
159158
return nil, &fs.PathError{Op: "read", Path: name, Err: fs.ErrInvalid}
160159
}

0 commit comments

Comments
 (0)