From 576d4494e836ebef301172ba35f482b1c452b8ee Mon Sep 17 00:00:00 2001 From: Shelton Zhu <498220739@qq.com> Date: Mon, 22 Jan 2024 15:07:47 +0800 Subject: [PATCH] Update 7z.go fix: fix iteration bug --- 7z.go | 1 + 1 file changed, 1 insertion(+) 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 }