diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26f08dc..17960b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,18 @@ jobs: go-version-file: go.mod cache: true + - name: Install deadcode + run: go install golang.org/x/tools/cmd/deadcode@v0.45.0 + + - name: Deadcode + run: | + output_file=$(mktemp) + "$(go env GOPATH)/bin/deadcode" -test ./... > "$output_file" + if [ -s "$output_file" ]; then + cat "$output_file" + exit 1 + fi + - name: Test run: go test ./... diff --git a/internal/routing/queue/queue.go b/internal/routing/queue/queue.go index c8d0f23..a074d28 100644 --- a/internal/routing/queue/queue.go +++ b/internal/routing/queue/queue.go @@ -20,22 +20,6 @@ func New(size int) *Queue { return &Queue{ch: make(chan Task, size)} } -func (q *Queue) Start(ctx context.Context) { - for { - select { - case <-ctx.Done(): - return - case task, ok := <-q.ch: - if !ok { - return - } - if task != nil { - _ = task(ctx) - } - } - } -} - func (q *Queue) Enqueue(task Task) bool { q.mu.Lock() defer q.mu.Unlock()