How can I add multiple operations in one transaction using the Go SDK? I am trying to add a dynamic amount of payment operations under 1 transaction and that seems to be not possible in Go as it's building a function.
I am new to Go, so please let me know if there is any way to add multiple operations dynamically inside one transaction.
In my code I added 4 operations manually. I want to know how to build them dynamically using a loop.
paymentTx, err := build.Transaction(
build.SourceAccount{recipient.Address()},
build.TestNetwork,
build.AutoSequence{SequenceProvider: horizon.DefaultTestNetClient},
build.Payment(
build.Destination{AddressOrSeed: Reciver2},
build.CreditAmount{cd.AssestTransfer.Asset[0].Code, issuerSeed, cd.AssestTransfer.Asset[0].Limit},
), build.Payment(
build.Destination{AddressOrSeed: Reciver2},
build.CreditAmount{cd.AssestTransfer.Asset[1].Code, issuerSeed, cd.AssestTransfer.Asset[1].Limit},
), build.Payment(
build.Destination{AddressOrSeed: Reciver2},
build.CreditAmount{cd.AssestTransfer.Asset[2].Code, issuerSeed, cd.AssestTransfer.Asset[2].Limit},
),
build.Payment(
build.SourceAccount{Reciver2},
build.Destination{AddressOrSeed: recipient.Address()},
build.CreditAmount{cd.AssestTransfer.Asset[3].Code, issuerSeed, cd.AssestTransfer.Asset[3].Limit},
),