AppendFormat is like Format but appends the textual representation to b and returns the extended buffer.
package main import ( "fmt" "time" ) func main() { t := time.Date(2017, time.November, 4, 11, 0, 0, 0, time.UTC) text := []byte("Time: ") text = t.AppendFormat(text, time.Kitchen) fmt.Println(string(text)) }