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
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]
