1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

fix: fix get tag failed

This commit is contained in:
dudaodong
2024-05-13 17:49:34 +08:00
parent 53fa210f09
commit 7893f828d3

View File

@@ -6,9 +6,11 @@ package maputil
import (
"fmt"
"golang.org/x/exp/constraints"
"reflect"
"sort"
"strings"
"golang.org/x/exp/constraints"
"github.com/duke-git/lancet/v2/slice"
)
@@ -379,7 +381,7 @@ func getFieldNameByJsonTag(structObj any, jsonTag string) string {
tag := field.Tag
name := tag.Get("json")
if name == jsonTag {
if strings.Contains(name, jsonTag) {
return field.Name
}
}