MCPcopy Index your code
hub / github.com/deepflowio/deepflow / shouldInitializeField

Function shouldInitializeField

server/controller/config/defaults.go:188–201  ·  view source on GitHub ↗
(field reflect.Value, tag string)

Source from the content-addressed store, hash-verified

186}
187
188func shouldInitializeField(field reflect.Value, tag string) bool {
189 switch field.Kind() {
190 case reflect.Struct:
191 return true
192 case reflect.Ptr:
193 if !field.IsNil() && field.Elem().Kind() == reflect.Struct {
194 return true
195 }
196 case reflect.Slice:
197 return field.Len() > 0 || tag != ""
198 }
199
200 return tag != ""
201}
202
203// Setter is an interface for setting default values
204type Setter interface {

Callers 1

setFieldFunction · 0.70

Calls 1

LenMethod · 0.65

Tested by

no test coverage detected