add example code for gconv.Map; comment updates of gdb

This commit is contained in:
John
2019-03-05 17:52:34 +08:00
parent f2c080d25f
commit 5d874e9063
5 changed files with 25 additions and 1 deletions

View File

@ -11,6 +11,7 @@
2.不支持save/replace方法
3.不支持LastInsertId方法
*/
package gdb
import (

View File

@ -11,6 +11,7 @@
2.不支持save/replace方法可以调用这2个方法估计会报错还没测试过,(应该是可以通过oracle的merge来实现这2个功能的还没仔细研究)
3.不支持LastInsertId方法
*/
package gdb
import (

View File

@ -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 (

View 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))
}