This is an automated email from the ASF dual-hosted git repository.

chenguangsheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/eventmesh-go.git

commit 884ee9fc6856f1151bfdbf16f987a9ad752f9b36
Author: Piyush <[email protected]>
AuthorDate: Thu Apr 20 17:40:43 2023 +0530

    Updated cloudevents.go #3765
---
 plugin/protocol/cloudevents/cloudevents.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugin/protocol/cloudevents/cloudevents.go 
b/plugin/protocol/cloudevents/cloudevents.go
index f1a52ca..c9fa9cc 100644
--- a/plugin/protocol/cloudevents/cloudevents.go
+++ b/plugin/protocol/cloudevents/cloudevents.go
@@ -47,12 +47,12 @@ func (c *CloudeventsPlugin) Setup(name string, dec 
plugin.Decoder) error {
 }
 
 func (c *CloudeventsPlugin) ToCloudEvent(msg interface{}) (*v2.Event, error) {
-       switch msg.(type) {
+       switch msg := msg.(type) {
        case *tcp.Package:
-               pck := msg.(*tcp.Package)
+               pck := msg
                return c.deserializeTcpProtocol(pck)
        case *grpc.SimpleMessageWrapper:
-               sw := msg.(*grpc.SimpleMessageWrapper)
+               sw := msg
                sm := sw.SimpleMessage
                return deserializeGrpcProtocol(sm)
        }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to