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

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new dae7141fa3 [INLONG-9174][SDK] Optimize response attr parsing in Golang 
SDK (#9175)
dae7141fa3 is described below

commit dae7141fa3831c8ccca1dde723b5e1542c194793
Author: gunli <24350...@qq.com>
AuthorDate: Wed Nov 1 09:49:46 2023 +0800

    [INLONG-9174][SDK] Optimize response attr parsing in Golang SDK (#9175)
    
    Co-authored-by: gunli <gu...@tencent.com>
---
 .../dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/request.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/request.go 
b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/request.go
index 187e074415..03bca16a6e 100755
--- a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/request.go
+++ b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/request.go
@@ -302,9 +302,13 @@ func (b *batchRsp) decode(input []byte) {
 
        // fmt.Println(string(attr))
 
-       attrList := strings.Split(string(attr), "&")
+       attrList := strings.FieldsFunc(string(attr), func(r rune) bool {
+               return r == '&'
+       })
        for _, item := range attrList {
-               kv := strings.Split(item, "=")
+               kv := strings.FieldsFunc(item, func(r rune) bool {
+                       return r == '='
+               })
                if len(kv) != 2 {
                        continue
                }

Reply via email to