go-try-get aka (GTG) is a package that wraps around the reflect package to provide a standard abstraction layer for getting values by name from objects (structs, maps, and single-value "property" functions). GTG is used by:
For example, with GTG, you can provide a single pathways for an API to process structs and maps, allowing automated structured input from systems, as well as user-based input unmarshaled from JSON.
You can import go-try-get as a library with:
import ( "github.com/spatialcurrent/go-try-get/pkg/gtg" )
See go.dev for information on how to use Go API.
This work is distributed under the MIT License. See LICENSE file.