experiment/tracer/trace.go
func (l linesByTimestamp) String() string {
	sort.Sort(l)

	var log string
	for i, line := range l {
		switch i {
		case len(l) - 1:
			log += string(line.actual)
		default:
			// buf.ReadBytes('\n') does not remove the newline
			log += fmt.Sprintf("%s,\n", strings.TrimSuffix(string(line.actual), "\n"))
		}
	}

	return fmt.Sprintf("[%s]", log)
}
func (l linesByTimestamp) String() string {
	sort.Sort(l)

	var log string
	for i, line := range l {
		switch i {
		case len(l) - 1:
			log += string(line.actual)
		default:
			// buf.ReadBytes('\n') does not remove the newline
			log += fmt.Sprintf("%s,\n", strings.TrimSuffix(string(line.actual), "\n"))
		}
	}

	return fmt.Sprintf("[%s]", log)
}
func ( l linesByTimestamp ) String ( ) string { sort . Sort ( l ) var log string for i , line := range l { switch i { case len ( l ) - 1 : log += string ( line . actual ) default : // buf.ReadBytes('\n') does not remove the newline log += fmt . Sprintf ( " \n " , strings . TrimSuffix ( string ( line . actual ) , " \n " ) ) } } return fmt . Sprintf ( " " , log ) }
// Return valid json.
Return valid json .