MCPcopy Create free account
hub / github.com/go-openapi/jsonpointer / GetGoName

Method GetGoName

jsonname/go_name_provider.go:79–83  ·  view source on GitHub ↗

GetGoName gets the go name for a json property name.

(subject any, name string)

Source from the content-addressed store, hash-verified

77
78// GetGoName gets the go name for a json property name.
79func (n *GoNameProvider) GetGoName(subject any, name string) (string, bool) {
80 tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
81
82 return n.GetGoNameForType(tpe, name)
83}
84
85// GetGoNameForType gets the go name for a given type for a json property name.
86func (n *GoNameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {

Calls 1

GetGoNameForTypeMethod · 0.95