This is exactly what I am after but in JS. How can I build a transaction with a dynamic list of mutators or operations using the Go SDK?
Something like this would be great, and then it'd be easy to loop over and abstract out from an array of operations. Likewise simply setting new Transaction.operations = an array of operations would be great.
var transaction = new StellarSdk.TransactionBuilder(account)
transaction.addOperation(StellarSdk.Operation.payment({
destination: pubKey,
asset: StellarSdk.Asset.native(),
amount: "1"
}));
transaction.addOperation(StellarSdk.Operation.payment({
destination: pubKey3,
asset: StellarSdk.Asset.native(),
amount: "1"
}))
transaction.build();
transaction.sign(StellarSdk.Keypair.fromSecret(privKey2));