Created
January 14, 2022 20:06
-
-
Save AntonStoeckl/8d1a9bdd5d32b663601ae2d0c9d5f498 to your computer and use it in GitHub Desktop.
Example for blog post Go bits: Interfaces and Nil Pointers
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{ | |
commandType: "RegisterCustomer", | |
} | |
} | |
func (c *RegisterCustomer) CommandType() string { | |
return c.commandType | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment