areflect

package
v0.0.0-...-a8d7af0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 13

Documentation

Overview

Package areflect provides utilities to help with reflection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceExport

func ForceExport(v reflect.Value) reflect.Value

ForceExport returns a new reflect.Value that is identical to the one passed in argument except that it's considered as an exported symbol even if in reality it isn't.

The `reflect' package intentionally makes it impossible to access the value of an unexported attribute. The implementation of reflect.DeepEqual() cheats as it bypasses this check. Unfortunately, we can't use the same cheat, which prevents us from re-implementing DeepEqual properly or implementing some other reflection-based tools. So this is our cheat on top of theirs. It makes the given reflect.Value appear as if it was exported.

This function requires go1.6 or newer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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