MCPcopy Create free account
hub / github.com/go-python/gopy / Work

Method Work

_examples/hi/hi.go:108–115  ·  view source on GitHub ↗

Work makes a Person go to work for h hours

(h int)

Source from the content-addressed store, hash-verified

106
107// Work makes a Person go to work for h hours
108func (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
118func (p *Person) Salary(h int) (int, error) {

Callers 2

NewActivePersonFunction · 0.95
test.pyFile · 0.80

Calls 1

PrintfFunction · 0.92

Tested by

no test coverage detected