MCPcopy
hub / github.com/uber-go/nilaway / ParamFieldAnnotationKey

Struct ParamFieldAnnotationKey

annotation/key.go:593–602  ·  view source on GitHub ↗

ParamFieldAnnotationKey allows the Lookup of Annotation of a function parameter's fields in the Annotation map. The key is used for tracking flows through both function params and the receiver. In case, the key is tracking nilability flow through receivers ParamNum is set to ReceiverParamIndex If th

Source from the content-addressed store, hash-verified

591// If the key is tracking flow from caller to callee then IsTrackingSideEffect is false. If the key is tracking flow
592// from callee to caller at return of the callee function then IsTrackingSideEffect is true
593type ParamFieldAnnotationKey struct {
594 // FuncDecl is the function corresponding to the key
595 FuncDecl *types.Func
596 // ParamNum is the index of the param. It is set to const ReceiverParamIndex -1 if IsReceiver is set to true
597 ParamNum int
598 // FieldDecl is the declaration of the field
599 FieldDecl *types.Var
600 // IsTrackingSideEffect is true if the key is used for tracking the param field nilability from callee to caller
601 IsTrackingSideEffect bool
602}
603
604// ReceiverParamIndex is used as the virtual index of the receiver. Since the struct initialization checking for fields
605// of params and fields of receiver uses similar logic, using this virtual index reduces a lot of code repetition.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected