post.gno
0.28 Kb ยท 18 lines
1package microposts
2
3import (
4 "std"
5 "time"
6)
7
8type Post struct {
9 text string
10 author std.Address
11 createdAt time.Time
12}
13
14func (p Post) String() string {
15 out := p.text + "\n"
16 out += "_" + p.createdAt.Format("02 Jan 2006, 15:04") + ", by " + p.author.String() + "_"
17 return out
18}