![5{MU`{3A69V)CP[F4JYZQ90.png](https://static.studygolang.com/171222/9eac2bbde41eb1584d38f0cafe95d32f.png)
![H~_L(7C0CS{((AVFNKN5E89.png](https://static.studygolang.com/171222/75a88b09acb510720379a1dbc26cf8ac.png)
该怎么修改一下 想传入tid title content三个进行修改
更多评论
```go
func ModifyTopic(tid, title, content string) error {
tidNum, err := strconv.ParseInt(tid, 10, 64)
if err != nil {
return nil, err
}
o := orm.NewOrm()
topic := &Topic{Id: tidNum}
if o.Read(topic) == nil {
topic.Title = title
topic.Content = content
topic.Update = time.Now()
o.Update(topic)
}
return err
}
```
#1