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: registry.go
    path of file: ./repos/TarsGo/tars/registry/tars
    
    the code of the file until where you have to start completion: package tars

import (
	"context"
	"fmt"

	"github.com/TarsCloud/TarsGo/tars/protocol/res/queryf"
	"github.com/TarsCloud/TarsGo/tars/registry"
)

type Context interface {
	Context() map[string]string
}

type tarsRegistry struct {
	query *queryf.QueryF
	ctx   Context
}

func New(query *queryf.QueryF, ctx Context) registry.
    
func (t *tarsRegistry) QueryServantBySet(ctx context.Context, id, set string) (activeEp []registry.Endpoint, inactiveEp []registry.Endpoint, err error) {
	ret, err := t.query.FindObjectByIdInSameSetWithContext(ctx, id, set, &activeEp, &inactiveEp, t.ctx.Context())
	if err != nil {
		return nil, nil, err
	}
	if ret != 0 {
		return nil, nil, fmt.Errorf("QueryServantBySet id: %s, setId: %s fail, ret: %d", id, set, ret)
	}
	return activeEp, inactiveEp, nil
}