package main type Log struct { Msg string } type Logs []Log var LogList Logs func (ll *Logs) Log(msg string) { *ll = append(*ll, Log{msg}) } func (ll Logs) ToString() string { res := "" for _, log := range ll { res += log.Msg + "\n" } return res }