From f19e7ccefa846ff36a300a965a28046ee3147ec7 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Sat, 9 Dec 2023 10:26:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20file.ReadLineWithPa?= =?UTF-8?q?rallel=20=E5=87=BD=E6=95=B0=E7=94=B1=E4=BA=8E=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E8=AF=BB=E5=8F=96=E6=95=B0=E9=87=8F=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=AF=BB=E5=92=8C=E6=95=88=E7=8E=87=E4=BD=8E?= =?UTF-8?q?=E4=B8=8B=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/file/file.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/file/file.go b/utils/file/file.go index 90b84c5..8cfe94c 100644 --- a/utils/file/file.go +++ b/utils/file/file.go @@ -2,6 +2,7 @@ package file import ( "bufio" + "fmt" "github.com/kercylan98/minotaur/utils/slice" "io" "os" @@ -186,7 +187,8 @@ func ReadLineWithParallel(filename string, chunkSize int64, handlerFunc func(str end = e + 1 } endMutex.Unlock() - r := io.NewSectionReader(file, chunk[0], e) + r := io.NewSectionReader(file, chunk[0], e-chunk[0]) + fmt.Println(chunk[0], e) scanner := bufio.NewScanner(r) for scanner.Scan() {