// string representation of a faulty set
string representation of a faulty set
// string representation of a faulty set
func (fs *FaultySet) String() string {
	fs.mutex.RLock()
	defer fs.mutex.RUnlock()
	var sb strings.Builder
	sb.WriteString("RESULTS\n\n")
	sb.WriteString("Faulty processes found: ")
	sb.WriteString(strconv.FormatInt(int64(fs.Length()), 10))
	sb.WriteString("\n\n")
	for processID, reasonsForProcess := range fs.faultinessMap {
		sb.WriteString("*** Process ")
		sb.WriteString(processID)
		sb.WriteString(" ***\n\n")
		for round, reasonsForRound := range reasonsForProcess {
			sb.WriteString("- ROUND ")
			sb.WriteString(strconv.FormatUint(round, 10))
			sb.WriteString("\n")
			for reason := range reasonsForRound {
				sb.WriteString(reason.FaultinessReason())
				sb.WriteString("\n")
			}
			sb.WriteString("\n")
		}
	}
	return sb.String()
}
func ( fs * FaultySet ) String ( ) string { fs . mutex . RLock ( ) defer fs . mutex . RUnlock ( ) var sb strings . Builder sb . WriteString ( " \n \n " ) sb . WriteString ( " " ) sb . WriteString ( strconv . FormatInt ( int64 ( fs . Length ( ) ) , 10 ) ) sb . WriteString ( " \n \n " ) for processID , reasonsForProcess := range fs . faultinessMap { sb . WriteString ( " " ) sb . WriteString ( processID ) sb . WriteString ( " \n \n " ) for round , reasonsForRound := range reasonsForProcess { sb . WriteString ( " " ) sb . WriteString ( strconv . FormatUint ( round , 10 ) ) sb . WriteString ( " \n " ) for reason := range reasonsForRound { sb . WriteString ( reason . FaultinessReason ( ) ) sb . WriteString ( " \n " ) } sb . WriteString ( " \n " ) } } return sb . String ( ) }
string representation of a faulty set
string representation of a faulty set