test: add method returning an error

This commit is contained in:
Sebastien Binet 2015-07-29 11:57:51 +02:00
parent d6d6d01ece
commit 36d61b0c8e
1 changed files with 11 additions and 0 deletions

View File

@ -56,3 +56,14 @@ func (p *Person) Greet() string {
func (p *Person) greet() string {
return fmt.Sprintf("Hello, I am %s", p.Name)
}
/*
// Work makes a Person go to work for h hours
func (p *Person) Work(h int) error {
fmt.Printf("working...\n")
if h > 7 {
return fmt.Errorf("can't work for %d hours!", h)
}
return nil
}
*/