code: func (s State) CheckValid() error {
  	switch s {
  	case StateNew, StateStart, StateClose:
  		return nil
  	default:
  		return errors.NewBadParameterError("iteration state", s).Expected(StateNew + "|" + StateStart + "|" + StateClose)
  	}
  }
docs: // CheckValid returns nil if the given iteration state is valid; otherwise a
  // BadParameterError is returned.