Work makes a Person go to work for h hours
(h int)
| 106 | |
| 107 | // Work makes a Person go to work for h hours |
| 108 | func (p *Person) Work(h int) error { |
| 109 | cpkg.Printf("working...\n") |
| 110 | if h > 7 { |
| 111 | return fmt.Errorf("can't work for %d hours!", h) |
| 112 | } |
| 113 | cpkg.Printf("worked for %d hours\n", h) |
| 114 | return nil |
| 115 | } |
| 116 | |
| 117 | // Salary returns the expected gains after h hours of work |
| 118 | func (p *Person) Salary(h int) (int, error) { |
no test coverage detected