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: handler.go
    path of file: ./repos/cosmos-sdk/x/tx/signing/textual
    
    the code of the file until where you have to start completion: package textual

import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"reflect"

	cosmos_proto "github.com/cosmos/cosmos-proto"
	"google.golang.org/protobuf/proto"
	"google.golang.org/protobuf/reflect/protoreflect"
	"google.golang.org/protobuf/reflect/protoregistry"
	"google.golang.org/protobuf/types/known/anypb"
	"g
    
func coerceToMessage(givenMsg, desiredMsg proto.Message) error {
	if reflect.TypeOf(givenMsg) == reflect.TypeOf(desiredMsg) {
		// Below is a way of saying "*desiredMsg = *givenMsg" using go reflect
		reflect.Indirect(reflect.ValueOf(desiredMsg)).Set(reflect.Indirect(reflect.ValueOf(givenMsg)))
		return nil
	}

	givenName, desiredName := givenMsg.ProtoReflect().Descriptor().FullName(), desiredMsg.ProtoReflect().Descriptor().FullName()
	if givenName != desiredName {
		return fmt.Errorf("expected dynamicpb.Message with FullName %s, got %s", desiredName, givenName)
	}

	desiredFields := desiredMsg.ProtoReflect().Descriptor().Fields()
	for i := 0; i < desiredFields.Len(); i++ {
		fd := desiredFields.Get(i)
		desiredMsg.ProtoReflect().Set(fd, getValueFromFieldName(givenMsg, string(fd.Name())))
	}

	return nil
}