mirror of https://github.com/go-python/gopy.git
test: add method returning an error
This commit is contained in:
parent
d6d6d01ece
commit
36d61b0c8e
|
@ -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
|
||||
}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue