diff --git a/7z.go b/7z.go index 44f8a00b..d57bd452 100644 --- a/7z.go +++ b/7z.go @@ -82,6 +82,7 @@ func (z SevenZip) Extract(ctx context.Context, sourceArchive io.Reader, pathsInA skipDirs := skipList{} for i, f := range zr.File { + f := f // make a copy for the Open closure if err := ctx.Err(); err != nil { return err // honor context cancellation }