Ejemplo n.º 1
0
Archivo: account.go Proyecto: rcijov/go
// Modify Account - old and new changes
func ModifyAccount(oldAcc *entities.Account, newAcc entities.Account) {
	if newAcc.Email != "" {
		oldAcc.Email = newAcc.Email
	}
	if newAcc.Phone != "" {
		oldAcc.Phone = newAcc.Phone
	}
	if newAcc.Type != "" {
		oldAcc.Type = newAcc.Type
	}
	if newAcc.Password != "" {
		oldAcc.Password = newAcc.Password
	}
}
Ejemplo n.º 2
0
Archivo: account.go Proyecto: rcijov/go
// Account to Entities Account
func AccToEnt(account Account) entities.Account {
	a := entities.Account{}
	a.Name = account.Name
	a.Email = account.Email
	a.Phone = account.Phone
	a.Password = account.Password
	a.Type = account.Type
	a.Date = account.Date
	return a
}