feat(cmd/gf): add ShardingPattern option for command gf gen dao to support generating dao files sharding tables (#4081)

This commit is contained in:
John Guo
2024-12-26 23:21:03 +08:00
committed by GitHub
parent f66e09717c
commit fc9093a1aa
29 changed files with 1145 additions and 868 deletions

View File

@ -42,21 +42,21 @@ func MapDelete(data map[string]interface{}, keys ...string) {
}
// MapMerge merges all map from `src` to map `dst`.
func MapMerge(dst map[string]interface{}, src ...map[string]interface{}) {
if dst == nil {
func MapMerge(dstMap map[string]interface{}, srcMaps ...map[string]interface{}) {
if dstMap == nil {
return
}
for _, m := range src {
for _, m := range srcMaps {
for k, v := range m {
dst[k] = v
dstMap[k] = v
}
}
}
// MapMergeCopy creates and returns a new map which merges all map from `src`.
func MapMergeCopy(src ...map[string]interface{}) (copy map[string]interface{}) {
func MapMergeCopy(maps ...map[string]interface{}) (copy map[string]interface{}) {
copy = make(map[string]interface{})
for _, m := range src {
for _, m := range maps {
for k, v := range m {
copy[k] = v
}