mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 21:28:22 +08:00
25 lines
389 B
Go
25 lines
389 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
)
|
|
|
|
func main() {
|
|
type User struct {
|
|
Uid int
|
|
Name string `gconv:"-"`
|
|
NickName string `gconv:"nickname, omitempty"`
|
|
Pass1 string `gconv:"password1"`
|
|
Pass2 string `gconv:"password2"`
|
|
}
|
|
user := User{
|
|
Uid: 100,
|
|
Name: "john",
|
|
Pass1: "123",
|
|
Pass2: "456",
|
|
}
|
|
fmt.Println(gconv.Map(user))
|
|
}
|