Gorp テーブル名とgorp.go
gorp.go
func InitDB() { db.Init() Dbm = &gorp.DbMap{Db: db.Db, Dialect: gorp.PostgresDialect{}} Dbm.AddTable(models.Hotel{}).SetKeys(true, "Id") // add a table, setting the table name to 'posts' and // specifying that the Id property is an auto incrementing PK Dbm.AddTableWithName(models.Post{}, "posts").SetKeys(true, "Id")
Primary Key を通知してやらないと、Updateが上手くかかりまぬ。
参考1 https://github.com/coopernurse/gorp
参考2 http://mattn.kaoriya.net/software/lang/go/20120914222828.htm