Skip to content

Commit 159d60f

Browse files
committed
Update alias-index.go
1 parent df160a0 commit 159d60f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

transformer/alias-index.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ func scanFile(wg *sync.WaitGroup, fileCh chan string, m *sync.Map) {
6666
}
6767

6868
reader := bufio.NewReader(file)
69-
counter := 0
69+
lineNum := 0
7070
for {
7171
line, err := reader.ReadString('\n')
72-
if err == io.EOF || counter >= 3 { // only read first 3 lines
72+
if err == io.EOF || lineNum >= 3 { // only read first 3 lines
7373
break
7474
}
7575
if err != nil {
@@ -84,6 +84,7 @@ func scanFile(wg *sync.WaitGroup, fileCh chan string, m *sync.Map) {
8484
m.Store(strings.TrimSpace(aliasID), filename)
8585
break
8686
}
87+
lineNum += 1
8788
}
8889

8990
file.Close()

0 commit comments

Comments
 (0)