Skip to content

Commit

Permalink
feat: add copy function. (#25)
Browse files Browse the repository at this point in the history
* optimization: slice sub.

* fix: rpc logger add more detail info.

* feat: add msg gateway error.

* refactor: separate functions with error containing message and error with only stack trace.

* feat: add stdout and stderr info.

* feat: add strings and sql log.

* feat: add copy function.
  • Loading branch information
FGadvancer authored Mar 19, 2024
1 parent 0edcd3c commit c82052c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/gin-gonic/gin v1.9.1
github.com/go-zookeeper/zk v1.0.3
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/jinzhu/copier v0.4.0
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
github.com/minio/minio-go/v7 v7.0.63
github.com/pkg/errors v0.9.1
Expand Down
6 changes: 6 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package utils

import (
"github.com/jinzhu/copier"
"math/rand"
"reflect"
"sort"
Expand Down Expand Up @@ -638,3 +639,8 @@ func GetMsgID(sendID string) string {
func int64ToString(i int64) string {
return strconv.FormatInt(i, 10)
}

// copy a by b b->a
func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error) {
return copier.Copy(a, b)
}

0 comments on commit c82052c

Please sign in to comment.