Skip to main content

typeencoding.go

typeencoding.go - Overview

This file provides functions for asserting the type of an object.

Detailed Documentation

Function: AssertTypeWithError

  • Purpose: Checks if the given object type te matches the expected object type t.
  • Parameters:
    • te (ObjectType): The type of the object.
    • t (ObjectType): The expected type of the object.
  • Returns: error: An error if the types do not match, otherwise nil.

Function: AssertType

  • Purpose: Checks if the given object type _type matches the expectedType. If they don't match, it returns a WrongKeyTypeErr error message as a byte slice.
  • Parameters:
    • _type (ObjectType): The type of the object.
    • expectedType (ObjectType): The expected type of the object.
  • Returns: []byte: A byte slice containing the WrongKeyTypeErr error message if the types do not match, otherwise nil.

Getting Started Relevance: NO