rtypes

package
v0.0.0-...-5a8e0f4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package rtypes provides utility functions to work with runtime types.

This includes comparison of types obtained from the use of reflect package against standard Go types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(rtype reflect.Type) (types.Type, error)

Convert reads the type from reflection and convert it to a known public static type.

func IsEqual

func IsEqual(rtype reflect.Type, typ types.Type) bool

IsEqual returns true if the reflect and static type are nominally the same.

i.e. same import package and same name within package. For most Go programs it's sufficient to consider them equivalent without a deeper comparison of type structure.

Types

type TypeComponents

type TypeComponents struct {
	PkgPath string // Package path of type
	Name    string // Name of type in package
}

TypeComponents represents different components of a type.

func (TypeComponents) IsPrimitive

func (c TypeComponents) IsPrimitive() bool

IsPrimitive returns true if the type is a built-in promitive (no import path).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL