mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 20:22:20 +08:00
refactor(binding): use maps.Copy for cleaner map handling
Signed-off-by: russcoss <russcoss@outlook.com>
This commit is contained in:
parent
048f6fb884
commit
ab9bbf28e9
@ -7,6 +7,7 @@ package binding
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -489,9 +490,7 @@ func setFormMap(ptr any, form map[string][]string) error {
|
|||||||
if !ok {
|
if !ok {
|
||||||
return ErrConvertMapStringSlice
|
return ErrConvertMapStringSlice
|
||||||
}
|
}
|
||||||
for k, v := range form {
|
maps.Copy(ptrMap, form)
|
||||||
ptrMap[k] = v
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user