summaryrefslogtreecommitdiff
path: root/make_chat.go
blob: 4e31aed215326a2dd19bca3226183749942cc98a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
}