Documentation ¶
Overview ¶
Package lookup provides functions for (unsafely) looking up values in dynamic maps, structures, etc.
Module is powered by: https://github.com/mcuadros/go-lookup
Note that this package is meant for testing purposes only. On a real application you would avoid unsafe reading of maps and structs as much as possible, and try to use the type system to your advantage.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Path ¶
Path performs a lookup into the given value using a string path. Panics on failure.
Example ¶
m := map[string]interface{}{ "nested": map[string]interface{}{ "value": "foo", }, } value := Path(testingT, m, "nested.value") fmt.Println(value)
Output: foo
func PathE ¶
PathE performs a lookup into the given value using a string path. Returns error on failure.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.