code: func parseDUID(p []byte) (DUID, error) {
  	b := buffer.New(p)
  	// DUID must have enough bytes to determine its type
  	if b.Len() < 2 {
  		return nil, io.ErrUnexpectedEOF
  	}
  
  	var d DUID
  	switch DUIDType(b.Read16()) {
  	case DUIDTypeLLT:
  		d = new(DUIDLLT)
  	case DUIDTypeEN:
  		d = new(DUIDEN)
  	case DUIDTypeLL:
  		d = new(DUIDLL)
  	case DUIDTypeUUID:
  		d = new(DUIDUUID)
  	default:
  		return nil, errUnknownDUID
  	}
  
  	return d, d.UnmarshalBinary(p)
  }
docs: // parseDUID returns the correct DUID type of the input byte slice as a
  // DUID interface type.