diff --git a/annotation/affiliation.go b/annotation/affiliation.go index 1f179af0..a04fe21d 100644 --- a/annotation/affiliation.go +++ b/annotation/affiliation.go @@ -62,7 +62,7 @@ func FullTriggerForInterfaceParamFlow(affiliation AffiliationPair, paramNum int) Annotation: &InterfaceParamReachesImplementation{ TriggerIfNilable: &TriggerIfNilable{ Ann: ParamKeyFromArgNum(affiliation.InterfaceMethod, paramNum)}, - AffiliationPair: &affiliation, + AffiliationPair: affiliation, }, Expr: affiliation.interfaceMethodAsExpr(), }, @@ -70,7 +70,7 @@ func FullTriggerForInterfaceParamFlow(affiliation AffiliationPair, paramNum int) Annotation: &MethodParamFromInterface{ TriggerIfNonNil: &TriggerIfNonNil{ Ann: ParamKeyFromArgNum(affiliation.ImplementingMethod, paramNum)}, - AffiliationPair: &affiliation, + AffiliationPair: affiliation, }, Expr: affiliation.implementingMethodAsExpr(), Guards: util.NoGuards(), @@ -91,7 +91,7 @@ func FullTriggerForInterfaceResultFlow(affiliation AffiliationPair, retNum int) Annotation: &MethodResultReachesInterface{ TriggerIfNilable: &TriggerIfNilable{ Ann: RetKeyFromRetNum(affiliation.ImplementingMethod, retNum)}, - AffiliationPair: &affiliation, + AffiliationPair: affiliation, }, Expr: affiliation.implementingMethodAsExpr(), }, @@ -99,7 +99,7 @@ func FullTriggerForInterfaceResultFlow(affiliation AffiliationPair, retNum int) Annotation: &InterfaceResultFromImplementation{ TriggerIfNonNil: &TriggerIfNonNil{ Ann: RetKeyFromRetNum(affiliation.InterfaceMethod, retNum)}, - AffiliationPair: &affiliation, + AffiliationPair: affiliation, }, Expr: affiliation.interfaceMethodAsExpr(), Guards: util.NoGuards(), diff --git a/annotation/copy_test.go b/annotation/copy_test.go index 17f85ca4..f15c5076 100644 --- a/annotation/copy_test.go +++ b/annotation/copy_test.go @@ -77,19 +77,19 @@ func getObjInfo(obj any) map[string]objInfo { // - number of fields // - pointer address (if the field is a struct and has at least one field) func (s *CopyTestSuite) TestCopy() { - expectedObjs := make(map[string]objInfo) - actualObjs := make(map[string]objInfo) + var expectedObjs, actualObjs map[string]objInfo for _, initStruct := range s.initStructs { + var copied any expectedObjs = getObjInfo(initStruct) switch t := initStruct.(type) { case ConsumingAnnotationTrigger: - tCopied := t.Copy() - actualObjs = getObjInfo(tCopied) + copied = t.Copy() + actualObjs = getObjInfo(copied) case Key: - kCopied := t.copy() - actualObjs = getObjInfo(kCopied) + copied = t.copy() + actualObjs = getObjInfo(copied) default: s.Failf("unknown type", "unknown type %T", t) }