func (s *State) String() string {
	s.mu.Lock()
	defer s.mu.Unlock()
	d, _ := json.Marshal(Status{
		ID:       s.id,
		LeaderID: s.leaderID,
		State:    s.StateString(s.state),
		Term:     s.term,
		VotedFor: s.votedFor,
	})
	return string(d)
}
// String will return the current states fields for debugging.
String will return the current states fields for debugging.
// String will return the current states fields for debugging .
func (s *State) String() string {
	s.mu.Lock()
	defer s.mu.Unlock()
	d, _ := json.Marshal(Status{
		ID:       s.id,
		LeaderID: s.leaderID,
		State:    s.StateString(s.state),
		Term:     s.term,
		VotedFor: s.votedFor,
	})
	return string(d)
}
func ( s * State ) String ( ) string { s . mu . Lock ( ) defer s . mu . Unlock ( ) d , _ := json . Marshal ( Status { ID : s . id , LeaderID : s . leaderID , State : s . StateString ( s . state ) , Term : s . term , VotedFor : s . votedFor , } ) return string ( d ) }
String will return the current states fields for debugging.
String will return the current states fields for debugging .