func (r *DockerPs) containerInformation(daemon docker.ContainerDaemon, cursor *ui.Cursor) string { buf := bytes.NewBufferString("") context := docker.FormattingContext{ Output: buf, Template: r.containerTemplate, Trunc: true, Selected: cursor.Line, } docker.Format( context, daemon.Containers()) return buf.String() }