1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package main import ( "go.wit.com/lib/protobuf/chatpb" "go.wit.com/log" ) func dumpEntry(entry *chatpb.ChatEntry) { log.Printf(entry.FormatTEXT()) } func dumpchat(chat *chatpb.Chat) { entries := chat.GetEntries() if len(entries) > 0 { lastEntry := entries[len(entries)-1] dumpEntry(lastEntry) } }