MCPcopy
hub / github.com/google/go-cmp / Values

Method Values

cmp/path.go:196–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194
195func (sf StructField) Type() reflect.Type { return sf.typ }
196func (sf StructField) Values() (vx, vy reflect.Value) {
197 if !sf.unexported {
198 return sf.vx, sf.vy // CanInterface reports true
199 }
200
201 // Forcibly obtain read-write access to an unexported struct field.
202 if sf.mayForce {
203 vx = retrieveUnexportedField(sf.pvx, sf.field, sf.paddr)
204 vy = retrieveUnexportedField(sf.pvy, sf.field, sf.paddr)
205 return vx, vy // CanInterface reports true
206 }
207 return sf.vx, sf.vy // CanInterface reports false
208}
209func (sf StructField) String() string { return fmt.Sprintf(".%s", sf.name) }
210
211// Name is the field name.

Callers

nothing calls this directly

Calls 1

retrieveUnexportedFieldFunction · 0.85

Tested by

no test coverage detected