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-workflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 14bf3af  [#3761] [Enhancement] eliminate type assertions
     new a6ce439  Merge pull request #4 from nikam14/patch-3
14bf3af is described below

commit 14bf3af7bdb54b2dc8350a08de54c31ba74ec672
Author: maheshnikam <[email protected]>
AuthorDate: Fri Apr 21 16:06:21 2023 +0530

    [#3761] [Enhancement] eliminate type assertions
---
 third_party/jqer/jqer.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/third_party/jqer/jqer.go b/third_party/jqer/jqer.go
index 9d80708..5896a1b 100644
--- a/third_party/jqer/jqer.go
+++ b/third_party/jqer/jqer.go
@@ -143,16 +143,16 @@ func (j *jqer) recursiveEvaluate(data, query interface{}) 
([]interface{}, error)
                return out, nil
        }
 
-       switch query.(type) {
+       switch query := query.(type) {
        case bool:
        case int:
        case float64:
        case string:
-               return j.recurseIntoString(data, query.(string))
+               return j.recurseIntoString(data, query)
        case map[string]interface{}:
-               return j.recurseIntoMap(data, query.(map[string]interface{}))
+               return j.recurseIntoMap(data, query)
        case []interface{}:
-               return j.recurseIntoArray(data, query.([]interface{}))
+               return j.recurseIntoArray(data, query)
        default:
                return nil, fmt.Errorf("unexpected type: %s", 
reflect.TypeOf(query).String())
        }


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

Reply via email to