)
// Use this to call external services. It will handle timeout and request cancellation gracefully.
-func CallExternalService(tag string, timeout time.Duration, routine func() *Error) *Error {
- routineDone := make(chan *Error)
+func CallExternalService(tag string, timeout time.Duration, routine func() error) error {
+ routineDone := make(chan error)
go func() {
routineDone <- routine()