Skip to content

Commit e792625

Browse files
authored
Use Go 1.25 (#186)
1 parent 73c97d2 commit e792625

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/pointlander/peg
22

3-
go 1.24
3+
go 1.25

tree/peg.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,8 @@ func (t *Tree) Compile(file string, args []string, out io.Writer) (err error) {
637637
usage := [TypeLast]uint{}
638638

639639
wg := sync.WaitGroup{}
640-
wg.Add(2)
641640

642-
go func() {
643-
defer wg.Done()
641+
wg.Go(func() {
644642
ruleReached := make([]bool, t.RulesCount)
645643
for n := range t.Iterator() {
646644
if n.GetType() == TypeRule {
@@ -655,17 +653,16 @@ func (t *Tree) Compile(file string, args []string, out io.Writer) (err error) {
655653
}
656654
}
657655
}
658-
}()
656+
})
659657

660-
go func() {
661-
defer wg.Done()
658+
wg.Go(func() {
662659
ruleReached := make([]bool, t.RulesCount)
663660
for n := range t.Iterator() {
664661
if n.GetType() == TypeRule {
665662
t.checkRecursion(n, ruleReached)
666663
}
667664
}
668-
}()
665+
})
669666

670667
wg.Wait()
671668

0 commit comments

Comments
 (0)