NewActivePerson creates a new Person with a certain amount of work done.
(h int)
| 85 | |
| 86 | // NewActivePerson creates a new Person with a certain amount of work done. |
| 87 | func NewActivePerson(h int) (*Person, error) { |
| 88 | p := &Person{} |
| 89 | err := p.Work(h) |
| 90 | return p, err |
| 91 | } |
| 92 | |
| 93 | func (p Person) String() string { |
| 94 | return fmt.Sprintf("hi.Person{Name=%q, Age=%d}", p.Name, p.Age) |