code: func (d *Decoder) DecodeEnum(validEnums map[int32]bool) (rv int32, err error) {
  	val, err := d.DecodeInt()
  	if err != nil {
  		return
  	}
  	if !validEnums[val] {
  		err = unmarshalError("DecodeEnum", ErrBadEnumValue, "invalid enum", val)
  		return
  	}
  	return val, nil
  }
docs: // DecodeEnum treats the next 4 bytes as an XDR encoded enumeration value and
  // returns the result as an int32 after verifying that the value is in the
  // provided map of valid values.
  //
  // An UnmarshalError is returned if there are insufficient bytes remaining or
  // the parsed enumeration value is not one of the provided valid values.
  //
  // Reference:
  // 	RFC Section 4.3 - Enumeration
  // 	Represented as an XDR encoded signed integer