Skip to content

Commit d76c3fe

Browse files
committed
fix: remove empty output
1 parent 8ab6c85 commit d76c3fe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cmd/function/invoke.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,15 @@ var invokeCmd = &cobra.Command{
6666
// If the value is a JSON, encode it
6767
if v, ok := output.(map[string]interface{}); ok {
6868
by, _ := json.Marshal(v)
69-
fmt.Println(string(by))
70-
return nil
69+
output = string(by)
70+
}
71+
72+
// We don't want to print an output if the function
73+
// returns an empty payload
74+
if output != "null" {
75+
fmt.Println(output)
7176
}
7277

73-
fmt.Println(output)
7478
return nil
7579
},
7680
}

0 commit comments

Comments
 (0)