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: QueryF.tars.go
    path of file: ./repos/TarsGo/tars/protocol/res/queryf
    
    the code of the file until where you have to start completion: // Code generated by tars2go 1.2.3, DO NOT EDIT.
// This file was generated from QueryF.tars
// Package queryf comment
package queryf

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"

	"github.com/TarsCloud/TarsGo/
    
func (obj *QueryF) FindObjectByIdInSameGroupWithContext(tarsCtx context.Context, id string, activeEp *[]endpointf.EndpointF, inactiveEp *[]endpointf.EndpointF, opts ...map[string]string) (ret int32, err error) {
	var (
		length int32
		have   bool
		ty     byte
	)
	buf := codec.NewBuffer()
	err = buf.WriteString(id, 1)
	if err != nil {
		return ret, err
	}

	err = buf.WriteHead(codec.LIST, 2)
	if err != nil {
		return ret, err
	}
	err = buf.WriteInt32(int32(len(*activeEp)), 0)
	if err != nil {
		return ret, err
	}
	for _, v := range *activeEp {
		err = v.WriteBlock(buf, 0)
		if err != nil {
			return ret, err
		}
	}

	err = buf.WriteHead(codec.LIST, 3)
	if err != nil {
		return ret, err
	}
	err = buf.WriteInt32(int32(len(*inactiveEp)), 0)
	if err != nil {
		return ret, err
	}
	for _, v := range *inactiveEp {
		err = v.WriteBlock(buf, 0)
		if err != nil {
			return ret, err
		}
	}

	var statusMap map[string]string
	var contextMap map[string]string
	if len(opts) == 1 {
		contextMap = opts[0]
	} else if len(opts) == 2 {
		contextMap = opts[0]
		statusMap = opts[1]
	}

	tarsResp := new(requestf.ResponsePacket)
	err = obj.servant.TarsInvoke(tarsCtx, 0, "findObjectByIdInSameGroup", buf.ToBytes(), statusMap, contextMap, tarsResp)
	if err != nil {
		return ret, err
	}
	readBuf := codec.NewReader(tools.Int8ToByte(tarsResp.SBuffer))
	err = readBuf.ReadInt32(&ret, 0, true)
	if err != nil {
		return ret, err
	}

	_, ty, err = readBuf.SkipToNoCheck(2, true)
	if err != nil {
		return ret, err
	}
	if ty == codec.LIST {
		err = readBuf.ReadInt32(&length, 0, true)
		if err != nil {
			return ret, err
		}
		*activeEp = make([]endpointf.EndpointF, length)
		for i5, e5 := int32(0), length; i5 < e5; i5++ {
			err = (*activeEp)[i5].ReadBlock(readBuf, 0, true)
			if err != nil {
				return ret, err
			}
		}
	} else if ty == codec.SimpleList {
		err = fmt.Errorf("not support SimpleList type")
		if err != nil {
			return ret, err
		}
	} else {
		err = fmt.Errorf("require vector, but not")
		if err != nil {
			return ret, err
		}
	}
	_, ty, err = readBuf.SkipToNoCheck(3, true)
	if err != nil {
		return ret, err
	}
	if ty == codec.LIST {
		err = readBuf.ReadInt32(&length, 0, true)
		if err != nil {
			return ret, err
		}
		*inactiveEp = make([]endpointf.EndpointF, length)
		for i6, e6 := int32(0), length; i6 < e6; i6++ {
			err = (*inactiveEp)[i6].ReadBlock(readBuf, 0, true)
			if err != nil {
				return ret, err
			}
		}
	} else if ty == codec.SimpleList {
		err = fmt.Errorf("not support SimpleList type")
		if err != nil {
			return ret, err
		}
	} else {
		err = fmt.Errorf("require vector, but not")
		if err != nil {
			return ret, err
		}
	}

	if len(opts) == 1 {
		for k := range contextMap {
			delete(contextMap, k)
		}
		for k, v := range tarsResp.Context {
			contextMap[k] = v
		}
	} else if len(opts) == 2 {
		for k := range contextMap {
			delete(contextMap, k)
		}
		for k, v := range tarsResp.Context {
			contextMap[k] = v
		}
		for k := range statusMap {
			delete(statusMap, k)
		}
		for k, v := range tarsResp.Status {
			statusMap[k] = v
		}
	}

	_ = length
	_ = have
	_ = ty
	return ret, nil
}