Skip to content

Commit

Permalink
Add a note on preserving transformation input
Browse files Browse the repository at this point in the history
  • Loading branch information
colmsnowplow committed Jul 3, 2024
1 parent b3829af commit 42f17db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/transform/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func NewTransformation(tranformFunctions ...TransformationFunction) Transformati
}

for _, message := range messages {
// We dereference here in order to avoid copying the input - when a transformation fails, we want the failure we create to contain the original input data
msg := *message // dereference to avoid amending input
success := &msg // success must be both input and output to a TransformationFunction, so we make this pointer.
var failure *models.Message
Expand Down

0 comments on commit 42f17db

Please sign in to comment.