call the callback function if defined

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-06 16:15:31 -07:00
parent 091f89c221
commit d86e39f9ed
1 changed files with 4 additions and 1 deletions

View File

@ -29,10 +29,13 @@ var bytesSplice []byte
func handleError(c interface{}, ret int) { func handleError(c interface{}, ret int) {
log.Println("shell.Run() Returned", ret) log.Println("shell.Run() Returned", ret)
if (callback != nil) {
callback(c, ret)
}
} }
func init() { func init() {
callback = handleError callback = nil
} }
func InitCallback(f func(interface{}, int)) { func InitCallback(f func(interface{}, int)) {