You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: testminer.go
    path of file: ./repos/lotus/miner
    
    the code of the file until where you have to start completion: package miner

import (
	"context"

	"github.com/hashicorp/golang-lru/arc/v2"
	ds "github.com/ipfs/go-datastore"

	"github.com/filecoin-project/go-address"
	"github.com/filecoin-project/go-state-types/abi"

	"github.com/filecoin-project/lotus/api/v1a
    
func chanWaiter(next <-chan MineReq) func(ctx context.Context, _ uint64) (func(bool, abi.ChainEpoch, error), abi.ChainEpoch, error) {
	return func(ctx context.Context, _ uint64) (func(bool, abi.ChainEpoch, error), abi.ChainEpoch, error) {
		select {
		case <-ctx.Done():
			return nil, 0, ctx.Err()
		case req := <-next:
			return req.Done, req.InjectNulls, nil
		}
	}
}