This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package customer | |
import ( | |
"github.com/AntonStoeckl/go-iddd/service/shared" | |
"github.com/cockroachdb/errors" | |
) | |
func assertNotDeleted(currentState currentState) error { | |
if currentState.isDeleted { | |
return errors.Mark(errors.New("customer was deleted"), shared.ErrNotFound) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package customer | |
import ( | |
"github.com/AntonStoeckl/go-iddd/service/customeraccounts/application/domain" | |
"github.com/AntonStoeckl/go-iddd/service/customeraccounts/application/domain/customer/value" | |
"github.com/AntonStoeckl/go-iddd/service/shared/es" | |
) | |
const ( | |
ShouldAddUniqueEmailAddress = iota |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package customer | |
import ( | |
"github.com/AntonStoeckl/go-iddd/service/shared/es" | |
) | |
type View struct { | |
ID string | |
EmailAddress string | |
IsEmailAddressConfirmed bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package customer | |
import ( | |
"github.com/AntonStoeckl/go-iddd/src/customeraccounts/hexagon/application/domain" | |
"github.com/AntonStoeckl/go-iddd/src/customeraccounts/hexagon/application/domain/customer/value" | |
"github.com/AntonStoeckl/go-iddd/src/shared/es" | |
) | |
type currentState struct { | |
id value.CustomerID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package customer | |
import ( | |
"github.com/AntonStoeckl/go-iddd/src/customeraccounts/hexagon/application/domain" | |
"github.com/AntonStoeckl/go-iddd/src/shared/es" | |
) | |
type View struct { | |
ID string | |
EmailAddress string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
panic: runtime error: invalid memory address or nil pointer dereference [recovered] | |
panic: runtime error: invalid memory address or nil pointer dereference | |
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4e4ea0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package commandhandling | |
type Command interface { | |
CommandType() string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package commandhandling | |
// RegisterCustomer implements the Command interface | |
type RegisterCustomer struct { | |
commandType string | |
// some useful properties | |
} | |
func NewRegisterCustomer() *RegisterCustomer { | |
return &RegisterCustomer{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package commandhandling_test | |
import ( | |
"testing" | |
"go-bits/interfaces-and-nil/commandhandling" | |
) | |
func TestNilInterface(_ *testing.T) { | |
var nilInterface commandhandling.Command |