MCPcopy
hub / github.com/golang/protobuf / GetProperties

Function GetProperties

proto/properties.go:219–225  ·  view source on GitHub ↗

map[reflect.Type]*StructProperties GetProperties returns the list of properties for the type represented by t, which must be a generated protocol buffer message in the open-struct API, where protobuf message fields are represented by exported Go struct fields. Deprecated: Use protobuf reflection in

(t reflect.Type)

Source from the content-addressed store, hash-verified

217//
218// Deprecated: Use protobuf reflection instead.
219func GetProperties(t reflect.Type) *StructProperties {
220 if p, ok := propertiesCache.Load(t); ok {
221 return p.(*StructProperties)
222 }
223 p, _ := propertiesCache.LoadOrStore(t, newProperties(t))
224 return p.(*StructProperties)
225}
226
227func newProperties(t reflect.Type) *StructProperties {
228 if t.Kind() != reflect.Struct {

Callers

nothing calls this directly

Calls 1

newPropertiesFunction · 0.85

Tested by

no test coverage detected