Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AntonStoeckl/ea359c6c6812a2b1eaaee9e9efcb883c to your computer and use it in GitHub Desktop.
Save AntonStoeckl/ea359c6c6812a2b1eaaee9e9efcb883c to your computer and use it in GitHub Desktop.
Example for my iDDD with Go blog article series at https://medium.com/@TonyBologni
package customer
import (
"github.com/AntonStoeckl/go-iddd/service/customeraccounts/application/domain/customer/value"
"github.com/AntonStoeckl/go-iddd/service/shared"
"github.com/cockroachdb/errors"
)
func assertMatchingConfirmationHash(current value.ConfirmationHash, supplied value.ConfirmationHash) error {
if !current.Equals(supplied) {
return errors.Mark(errors.New("wrong confirmation hash supplied"), shared.ErrDomainConstraintsViolation)
}
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment