An open API service indexing awesome lists of open source software.

https://github.com/twmb/vali

An unsafe use of reflect.Value to sidestep an arbitrary limitation.
https://github.com/twmb/vali

Last synced: about 1 year ago
JSON representation

An unsafe use of reflect.Value to sidestep an arbitrary limitation.

Awesome Lists containing this project

README

          

vali
====

[![GoDoc](https://godoc.org/github.com/twmb/vali?status.svg)](https://godoc.org/github.com/twmb/vali)

This package provides a function to unsafely obtain an `interface{}` value from
a `reflect.Value` without panicking. This is useful in scenarios where the
`reflect.Value` was obtained by accessing unexported struct fields.

The package is dependent on some Go internal struct layouts and constants, but
the layouts and constants have not changed in many Go releases.

Full documentation can be found on [`godoc`](https://godoc.org/github.com/twmb/vali).