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

Method filter

cmp/options.go:181–189  ·  view source on GitHub ↗
(s *state, t reflect.Type, vx, vy reflect.Value)

Source from the content-addressed store, hash-verified

179}
180
181func (f valuesFilter) filter(s *state, t reflect.Type, vx, vy reflect.Value) applicableOption {
182 if !vx.IsValid() || !vx.CanInterface() || !vy.IsValid() || !vy.CanInterface() {
183 return nil
184 }
185 if (f.typ == nil || t.AssignableTo(f.typ)) && s.callTTBFunc(f.fnc, vx, vy) {
186 return f.opt.filter(s, t, vx, vy)
187 }
188 return nil
189}
190
191func (f valuesFilter) String() string {
192 return fmt.Sprintf("FilterValues(%s, %v)", function.NameOf(f.fnc), f.opt)

Callers

nothing calls this directly

Calls 2

callTTBFuncMethod · 0.80
filterMethod · 0.65

Tested by

no test coverage detected