From 9f7ece0598633ee02210b6202fa96a8b27a99fb9 Mon Sep 17 00:00:00 2001 From: yuyiyue Date: Thu, 24 Nov 2022 10:25:27 +0800 Subject: [PATCH 1/2] change tag name expr to json --- .idea/.gitignore | 8 ++++++++ .idea/expr.iml | 9 +++++++++ .idea/modules.xml | 8 ++++++++ .idea/thriftCompiler.xml | 6 ++++++ .idea/vcs.xml | 6 ++++++ conf/types_table.go | 2 +- vm/runtime/runtime.go | 2 +- 7 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/expr.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/thriftCompiler.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..13566b81b --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/expr.iml b/.idea/expr.iml new file mode 100644 index 000000000..5e764c4f0 --- /dev/null +++ b/.idea/expr.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..205ebd572 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/thriftCompiler.xml b/.idea/thriftCompiler.xml new file mode 100644 index 000000000..7bc123c6b --- /dev/null +++ b/.idea/thriftCompiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/conf/types_table.go b/conf/types_table.go index e917f5fa8..626fafb99 100644 --- a/conf/types_table.go +++ b/conf/types_table.go @@ -116,7 +116,7 @@ func dereference(t reflect.Type) reflect.Type { } func FieldName(field reflect.StructField) string { - if taggedName := field.Tag.Get("expr"); taggedName != "" { + if taggedName := field.Tag.Get("json"); taggedName != "" { return taggedName } return field.Name diff --git a/vm/runtime/runtime.go b/vm/runtime/runtime.go index 3039a8f3e..9c01c31b1 100644 --- a/vm/runtime/runtime.go +++ b/vm/runtime/runtime.go @@ -52,7 +52,7 @@ func Fetch(from, i interface{}) interface{} { fieldName := i.(string) value := v.FieldByNameFunc(func(name string) bool { field, _ := v.Type().FieldByName(name) - if field.Tag.Get("expr") == fieldName { + if field.Tag.Get("json") == fieldName { return true } return name == fieldName From 5887d163dbe1a0650ba7130f670463abdd8762b4 Mon Sep 17 00:00:00 2001 From: yuyiyue Date: Thu, 24 Nov 2022 10:25:38 +0800 Subject: [PATCH 2/2] change tag name expr to json --- .idea/.gitignore | 8 -------- .idea/expr.iml | 9 --------- .idea/modules.xml | 8 -------- .idea/thriftCompiler.xml | 6 ------ .idea/vcs.xml | 6 ------ 5 files changed, 37 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/expr.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/thriftCompiler.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81b..000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/expr.iml b/.idea/expr.iml deleted file mode 100644 index 5e764c4f0..000000000 --- a/.idea/expr.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 205ebd572..000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/thriftCompiler.xml b/.idea/thriftCompiler.xml deleted file mode 100644 index 7bc123c6b..000000000 --- a/.idea/thriftCompiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4..000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file