mirror of
https://gitee.com/johng/gf
synced 2026-06-07 10:22:11 +08:00
add example code for gconv.Map; comment updates of gdb
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
2.不支持save/replace方法
|
||||
3.不支持LastInsertId方法
|
||||
*/
|
||||
|
||||
package gdb
|
||||
|
||||
import (
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
2.不支持save/replace方法,可以调用这2个方法估计会报错,还没测试过,(应该是可以通过oracle的merge来实现这2个功能的,还没仔细研究)
|
||||
3.不支持LastInsertId方法
|
||||
*/
|
||||
|
||||
package gdb
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://github.com/gogf/gf.
|
||||
|
||||
|
||||
package gdb
|
||||
|
||||
import (
|
||||
|
||||
23
geg/util/gconv/gconv_map2.go
Normal file
23
geg/util/gconv/gconv_map2.go
Normal file
@ -0,0 +1,23 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user