Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

post.gno

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