mirror of https://github.com/go-python/gopy.git
test: add ctor with comma-err
This commit is contained in:
parent
79e0e447cb
commit
7fa9bcd9cd
|
@ -51,6 +51,13 @@ func NewPersonWithAge(age int) Person {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewActivePerson creates a new Person with a certain amount of work done.
|
||||||
|
func NewActivePerson(h int) (Person, error) {
|
||||||
|
var p Person
|
||||||
|
err := p.Work(h)
|
||||||
|
return p, err
|
||||||
|
}
|
||||||
|
|
||||||
func (p Person) String() string {
|
func (p Person) String() string {
|
||||||
return fmt.Sprintf("hi.Person{Name=%q, Age=%d}", p.Name, p.Age)
|
return fmt.Sprintf("hi.Person{Name=%q, Age=%d}", p.Name, p.Age)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue