Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
theunrepentantgeek committed Jun 7, 2024
1 parent 3466e84 commit 50ab0f1
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,19 @@ func newEmptyARMValueBody(instanceType astmodel.InternalTypeName) ObjectFunction
methodName string,
) (*dst.FuncDecl, error) {
receiverName := fn.IdFactory().CreateReceiver(receiver.Name())
receiverType, err := receiver.AsTypeExpr(genContext)
receiverTypeExpr, err := receiver.AsTypeExpr(genContext)
if err != nil {
return nil, errors.Wrapf(err, "creating type expression for %s", receiver)
}
receiverTypeExpr = astbuilder.PointerTo(receiverTypeExpr)

receiverTypeExpr := astbuilder.PointerTo(receiverType)
// return &<pkg.instanceType>{}
instanceTypeExpr, err := instanceType.AsTypeExpr(genContext)
if err != nil {
return nil, errors.Wrapf(err, "creating type expression for %s", instanceType)
}

instance := astbuilder.NewCompositeLiteralBuilder(dst.NewIdent(instanceType.Name()))
instance := astbuilder.NewCompositeLiteralBuilder(instanceTypeExpr)
returnInstance := astbuilder.Returns(astbuilder.AddrOf(instance.Build()))

details := &astbuilder.FuncDetails{
Expand Down

0 comments on commit 50ab0f1

Please sign in to comment.