summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-06-06 16:15:31 -0700
committerJeff Carr <[email protected]>2019-06-06 16:15:31 -0700
commitd86e39f9ed71d444a37e3a47b87a8b5fd5e7770a (patch)
treeaf2fe992a0ccaf0a3a3c9b8c4c8c359b53fe4630
parent091f89c221816756d422809690793e63ba5b833c (diff)
call the callback function if defined
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--shell.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/shell.go b/shell.go
index be51271..f58eab9 100644
--- a/shell.go
+++ b/shell.go
@@ -29,10 +29,13 @@ var bytesSplice []byte
func handleError(c interface{}, ret int) {
log.Println("shell.Run() Returned", ret)
+ if (callback != nil) {
+ callback(c, ret)
+ }
}
func init() {
- callback = handleError
+ callback = nil
}
func InitCallback(f func(interface{}, int)) {