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: callback.go
    path of file: ./repos/go-ibax/packages/service/jsonrpc
    
    the code of the file until where you have to start completion: /*---------------------------------------------------------------------------------------------
 *  Copyright (c) IBAX. All rights reserved.
 *  See LICENSE in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
package jsonrpc

import (
	"github.com/IBAX-io/go-ibax/packages/consts"
	log "github.com/sirupsen/logrus"
	"reflect"
	"runtime"
	"unicode"
)

var (
	errorType     = reflect.TypeOf((*Error)(nil)).Elem()
	contextType   = reflect.TypeOf((*RequestContext)(nil)).E
    
func newCallback(receiver, fn reflect.Value) *callback {
	ftype := fn.Type()
	c := &callback{fn: fn, recv: receiver, errIndex: -1}
	// Determine parameter types. They must all be exported or builtin types.
	c.getArgsTypes()

	// Verify return types. The function must return at most one error
	// and/or one other non-error value.
	outs := make([]reflect.Type, ftype.NumOut())
	for i := 0; i < ftype.NumOut(); i++ {
		outs[i] = ftype.Out(i)
	}
	if len(outs) > 2 {
		return nil
	}

	switch {
	//
	case len(outs) == 1 && isErrorType(outs[0]):
		c.errIndex = 0
	// If an error is returned, it must be the last returned value.
	case len(outs) == 2:
		if isErrorType(outs[0]) || !isErrorType(outs[1]) {
			return nil
		}
		c.errIndex = 1
	}
	return c
}