func (s *State) LeaderID(id ...int) int {
	s.mu.Lock()
	defer s.mu.Unlock()
	if len(id) > 0 {
		s.leaderID = id[0]
	}
	return s.leaderID
}
// LeaderID will return the states current leader id or if
// an argument is passed in will set the current LeaderID.
LeaderID will return the states current leader id or if
an argument is passed in will set the current LeaderID.
// LeaderID will return the states current leader id or if // an argument is passed in will set the current LeaderID .
func (s *State) LeaderID(id ...int) int {
	s.mu.Lock()
	defer s.mu.Unlock()
	if len(id) > 0 {
		s.leaderID = id[0]
	}
	return s.leaderID
}
func ( s * State ) LeaderID ( id ... int ) int { s . mu . Lock ( ) defer s . mu . Unlock ( ) if len ( id ) > 0 { s . leaderID = id [ 0 ] } return s . leaderID }
LeaderID will return the states current leader id or if
an argument is passed in will set the current LeaderID.
LeaderID will return the states current leader id or if an argument is passed in will set the current LeaderID .