Les comparto mis implementaciones de getMessage para FullTimeEmployee
y TemporaryEmployee
😃:
func (ftEmployee FullTimeEmployee) getMessage() string {
return fmt.Sprintf("\nFull Time Employee\nid: %d name: %s age: %d endDate: %s",
ftEmployee.id,
ftEmployee.name,
ftEmployee.age,
ftEmployee.endDate)
}
func (tEmployee TemporaryEmployee) getMessage() string {
return fmt.Sprintf("\nTemporary Employee\nid: %d name: %s age: %d taxRate: %d",
tEmployee.id,
tEmployee.name,
tEmployee.age,
tEmployee.taxRate)
}
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?