code refactor

This commit is contained in:
MaysWind
2023-09-17 18:07:09 +08:00
parent 4cecc78a74
commit 0b678fe69a
26 changed files with 101 additions and 101 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import (
)
// PrintJsonSuccessResult writes success response in json format to current http context
func PrintJsonSuccessResult(c *core.Context, result interface{}) {
func PrintJsonSuccessResult(c *core.Context, result any) {
c.JSON(http.StatusOK, gin.H{
"success": true,
"result": result,
+2 -2
View File
@@ -8,7 +8,7 @@ import (
)
// Clone deep-clones src object to dst object
func Clone(src, dst interface{}) error {
func Clone(src, dst any) error {
var buf bytes.Buffer
if err := gob.NewEncoder(&buf).Encode(src); err != nil {
@@ -25,7 +25,7 @@ func Clone(src, dst interface{}) error {
}
// PrintObjectFields prints all fields in specified object
func PrintObjectFields(obj interface{}) {
func PrintObjectFields(obj any) {
if obj == nil {
return
}