code: func (enc *Encoder) EncodeEnum(v int32, validEnums map[int32]bool) (int, error) {
  	if !validEnums[v] {
  		err := marshalError("EncodeEnum", ErrBadEnumValue,
  			"invalid enum", v, nil)
  		return 0, err
  	}
  	return enc.EncodeInt(v)
  }
docs: // EncodeEnum treats the passed 32-bit signed integer as an enumeration value
  // and, if it is in the list of passed valid enumeration values, writes the XDR
  // encoded representation of it to the encapsulated writer.  It returns the
  // number of bytes written.
  //
  // A MarshalError is returned if the enumeration value is not one of the
  // provided valid values or if writing the data fails.
  //
  // Reference:
  // 	RFC Section 4.3 - Enumeration
  // 	Represented as an XDR encoded signed integer