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

Interface Key

annotation/key.go:24–48  ·  view source on GitHub ↗

A Key is an object that can be looked up in a Map

Source from the content-addressed store, hash-verified

22
23// A Key is an object that can be looked up in a Map
24type Key interface {
25 // Lookup checks whether this key is present in a given Map - returning false as its
26 // second result if not present, and true as its second result with the Val found if
27 // one is found.
28 // To provide optimistic defaults for unannotated files (formally - files on which the annotations
29 // checker has not been run), uses of `Lookup` such as `CheckProduce` and `CheckConsume` always
30 // return false (i.e. "don't trigger") if the key they wrap is not found in the map.
31 // Since not triggering on the level of a produce or consume trigger always results in fewer
32 // errors, this gives optimistic defaults to library code.
33 Lookup(Map) (Val, bool)
34
35 // Object returns the underlying object that this annotation key can be interpreted as annotating
36 Object() types.Object
37
38 // String returns a string representation of this annotation key
39 // These get stored into PrimitiveAnnotationKeys - so KEEP THEM COMPACT
40 // a good guideline would be the length of their name plus no more than 10 characters
41 String() string
42
43 // equals returns true if the passed key is equal to this key
44 equals(Key) bool
45
46 // copy returns a deep copy of this key
47 copy() Key
48}
49
50// FieldAnnotationKey allows the Lookup of a field's Annotation in the Annotation map
51type FieldAnnotationKey struct {

Callers 28

TestGroupErrorMessagesFunction · 0.65
getFuncObjFunction · 0.65
collectClosureFunction · 0.65
CheckProduceMethod · 0.65
CheckProduceMethod · 0.65
CheckConsumeMethod · 0.65
CheckConsumeMethod · 0.65
collectFunctionContractsFunction · 0.65
siteMethod · 0.65
TestGroupErrorMessagesFunction · 0.65

Implementers 12

FieldAnnotationKeyannotation/key.go
ParamAnnotationKeyannotation/key.go
CallSiteRetAnnotationKeyannotation/key.go
RetAnnotationKeyannotation/key.go
TypeNameAnnotationKeyannotation/key.go
GlobalVarAnnotationKeyannotation/key.go
LocalVarAnnotationKeyannotation/key.go
RetFieldAnnotationKeyannotation/key.go
EscapeFieldAnnotationKeyannotation/key.go
ParamFieldAnnotationKeyannotation/key.go
RecvAnnotationKeyannotation/key.go

Calls

no outgoing calls

Tested by

no test coverage detected