随笔分类 -  golang

摘要:here is the code of a structtype Post struct { Id int `db:"id"` Title string `db:"title"` Content string `db:"content"` Create_time int64 `db:"create_time"`}func (p Post) AttrCreatetime() time.Time { return time.Unix(p.Create_time, 0)} How to call the function 阅读全文
posted @ 2013-04-25 11:59 DavidHHuan 阅读(888) 评论(0) 推荐(0) 编辑
摘要:struct结构如下:package modelsimport ( "github.com/robfig/revel")type Post struct { id int title string}我在另一个包里面使用package controllersimport ( "blog/app/models" "fmt" "github.com/coopernurse/gorp" "github.com/robfig/revel")type Application struct { *revel. 阅读全文
posted @ 2013-04-09 18:29 DavidHHuan 阅读(5555) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示