README updates

This commit is contained in:
John
2018-04-29 22:25:12 +08:00
parent 0466f88ebe
commit bd7de6e522
2 changed files with 19 additions and 3 deletions

View File

@ -65,6 +65,7 @@ gf是一款模块化、松耦合、轻量级、高性能的Web开发框架。开
* [ORM链式操作](http://gf.johng.cn/596224)
* [ORM方法操作](http://gf.johng.cn/596223)
* [ORM事务操作](http://gf.johng.cn/596225)
* [ORM高级用法](http://gf.johng.cn/606435)
* [框架开发进阶](http://gf.johng.cn/598801)
* [HTTPS服务](http://gf.johng.cn/598802)
* [服务性能分析](http://gf.johng.cn/592298)

View File

@ -2,10 +2,25 @@ package main
import (
"fmt"
"gitee.com/johng/gf/g/util/gutil"
)
// 自定义的struct
type User struct {
Uid int
Name string
}
// map[uid:1 name:john3 email: type:1]
// {1 john3}
func main() {
fmt.Println(gutil.LcFirst("ABC"))
fmt.Println(gutil.UcFirst("abc"))
if r, err := db.Table("user").Where("uid=?", 1).One(); err == nil {
u := User{}
if err := r.ToStruct(&u); err == nil {
fmt.Println(u)
} else {
fmt.Println(err)
}
} else {
fmt.Println(err)
}
}