28 lines
450 B
Go
28 lines
450 B
Go
package chatpb
|
|
|
|
func (t *Table) AddRow(f []string) {
|
|
r := new(Row)
|
|
r.Fields = f
|
|
t.Rows = append(t.Rows, r)
|
|
}
|
|
|
|
func (c *Chats) AddTable() *Table {
|
|
chat := new(Chat)
|
|
|
|
t := new(Table)
|
|
t.Columns = 4
|
|
// t.Rows = append(t.Rows, []string{"a", "b"})
|
|
|
|
r := new(Row)
|
|
r.Fields = []string{"j", "r", "a", "b"}
|
|
t.Rows = append(t.Rows, r)
|
|
|
|
r = new(Row)
|
|
r.Fields = []string{"1", "", "2", "3"}
|
|
t.Rows = append(t.Rows, r)
|
|
|
|
c.AppendNew(chat)
|
|
|
|
return t
|
|
}
|