func (s *State) State(state ...int) int {
	s.mu.Lock()
	defer s.mu.Unlock()
	if len(state) > 0 {
		if s.state != state[0] {
			s.state = state[0]
			go func() {
				s.stateChangeChan <- state[0]
			}()
		}
	}
	return s.state
}
// State will return the states current state or if
// an argument is passed in will set the state
State will return the states current state or if
an argument is passed in will set the state
// State will return the states current state or if // an argument is passed in will set the state
func (s *State) State(state ...int) int {
	s.mu.Lock()
	defer s.mu.Unlock()
	if len(state) > 0 {
		if s.state != state[0] {
			s.state = state[0]
			go func() {
				s.stateChangeChan <- state[0]
			}()
		}
	}
	return s.state
}
func ( s * State ) State ( state ... int ) int { s . mu . Lock ( ) defer s . mu . Unlock ( ) if len ( state ) > 0 { if s . state != state [ 0 ] { s . state = state [ 0 ] go func ( ) { s . stateChangeChan <- state [ 0 ] } ( ) } } return s . state }
State will return the states current state or if
an argument is passed in will set the state
State will return the states current state or if an argument is passed in will set the state