mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
some modernization, remove debug prints, pin go 1.25
This commit is contained in:
parent
ced740f32d
commit
6a89f1e352
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -6,7 +6,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go: [ '1.25', '1.24' ]
|
||||
go: [ '1.25' ]
|
||||
name: Go ${{ matrix.go }} test
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
|
|
|
|||
|
|
@ -510,11 +510,9 @@ func (f *Filter) Loop(ctx context.Context, cancel func()) error {
|
|||
|
||||
f.state.Hub().SendStatusMsg(ctx, "Running query...", 0)
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
f.Work(workctx, q)
|
||||
}()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/peco/peco
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/gdamore/tcell/v2 v2.13.8
|
||||
|
|
|
|||
12
peco_test.go
12
peco_test.go
|
|
@ -928,18 +928,14 @@ func TestCancelFuncDataRace(t *testing.T) {
|
|||
// p.err would be flagged.
|
||||
var wg sync.WaitGroup
|
||||
for range 10 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = p.Err()
|
||||
}()
|
||||
})
|
||||
}
|
||||
for i := range 5 {
|
||||
wg.Add(1)
|
||||
go func(i int) {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
p.Exit(fmt.Errorf("exit-%d", i))
|
||||
}(i)
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package pipeline
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
|
@ -25,7 +24,6 @@ func NewRegexpFilter(rx *regexp.Regexp) *RegexpFilter {
|
|||
}
|
||||
|
||||
func (rf *RegexpFilter) Accept(ctx context.Context, in <-chan line.Line, out ChanOutput) {
|
||||
defer fmt.Println("END RegexpFilter.Accept")
|
||||
defer close(out)
|
||||
for {
|
||||
select {
|
||||
|
|
@ -63,8 +61,6 @@ func (f *LineFeeder) Reset() {
|
|||
}
|
||||
|
||||
func (f *LineFeeder) Start(ctx context.Context, out ChanOutput) {
|
||||
fmt.Println("START LineFeeder.Start")
|
||||
defer fmt.Println("END LineFeeder.Start")
|
||||
defer close(out)
|
||||
for _, l := range f.lines {
|
||||
out.Send(ctx, l)
|
||||
|
|
@ -92,7 +88,6 @@ func (r *Receiver) Done() <-chan struct{} {
|
|||
}
|
||||
|
||||
func (r *Receiver) Accept(ctx context.Context, in <-chan line.Line, _ ChanOutput) {
|
||||
defer fmt.Println("END Receiver.Accept")
|
||||
defer close(r.done)
|
||||
|
||||
for {
|
||||
|
|
|
|||
Loading…
Reference in a new issue