Skip to content

Instantly share code, notes, and snippets.

@cn0047
Last active October 29, 2018 16:20
Show Gist options
  • Select an option

  • Save cn0047/3f98f2f6c8183ab80340f07ebf5b3d38 to your computer and use it in GitHub Desktop.

Select an option

Save cn0047/3f98f2f6c8183ab80340f07ebf5b3d38 to your computer and use it in GitHub Desktop.
GO ValueObject - example 3
func CreateNewUser() {
vo, err := CreateUserVO.New(params) // params - map with vo params
if err != nil {
// just handle errors: vo.GetErrors()
}
// ...
db.SaveUser(vo)
mailer.SendEmail(vo)
search.AddUser(vo)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment