go-goon: github.com/shurcooL/go-goon/bypass Index | Files

package bypass

import "github.com/shurcooL/go-goon/bypass"

Package bypass allows bypassing reflect restrictions on accessing unexported struct fields.

Index

Package Files

main.go

func UnsafeReflectValue Uses

func UnsafeReflectValue(v reflect.Value) (rv reflect.Value)

UnsafeReflectValue converts the passed reflect.Value into a one that bypasses the typical safety restrictions preventing access to unaddressable and unexported data. It works by digging the raw pointer to the underlying value out of the protected value and generating a new unprotected (unsafe) reflect.Value to it.

This allows us to check for implementations of the Stringer and error interfaces to be used for pretty printing ordinarily unaddressable and inaccessible values such as unexported struct fields.

Package bypass imports 2 packages (graph) and is imported by 3 packages. Updated 2016-07-29. Refresh now. Tools for package owners.