mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +08:00
24 lines
387 B
Go
24 lines
387 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gogf/gf/g/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))
|
|
}
|