1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00
This commit is contained in:
2022-04-29 17:18:27 +08:00
parent 830a870158
commit f6ecb9be4b
4 changed files with 62 additions and 7 deletions

View File

@ -7,6 +7,7 @@ import (
type optionFunc func(*option)
type option struct {
SkipFields []string
TagName string
DeepCopy bool
Omitempty bool
@ -39,6 +40,18 @@ func DeepCopy() optionFunc {
}
}
func SkipField(field string) optionFunc {
return func(o *option) {
o.SkipFields = append(o.SkipFields, field)
}
}
func SkipFields(fields []string) optionFunc {
return func(o *option) {
o.SkipFields = append(o.SkipFields, fields...)
}
}
func Lcfirst() optionFunc {
return func(o *option) {
o.NameConverter = json.Lcfirst