Skip to content

Instantly share code, notes, and snippets.

@AntonStoeckl
Created January 14, 2022 20:06
Show Gist options
  • Save AntonStoeckl/8d1a9bdd5d32b663601ae2d0c9d5f498 to your computer and use it in GitHub Desktop.
Save AntonStoeckl/8d1a9bdd5d32b663601ae2d0c9d5f498 to your computer and use it in GitHub Desktop.
Example for blog post Go bits: Interfaces and Nil Pointers
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