From af7be4729322ea8b6681f6ab35cbe5be876d18ca Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 17 Apr 2018 19:58:42 +0900 Subject: [PATCH] ing --- core/interfaces/Service.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/interfaces/Service.go b/core/interfaces/Service.go index 073e658..da218eb 100644 --- a/core/interfaces/Service.go +++ b/core/interfaces/Service.go @@ -8,8 +8,8 @@ import ( type Service interface { InitService() error StartService() error - StopService() error - DestroyService() error + StopService() + DestroyService() } type ServiceMethodType int @@ -73,8 +73,13 @@ func ExecServices(services []interface{}, method ServiceMethodType, orderedTypes iv := reflect.ValueOf(i) m := iv.MethodByName(method.String()) rvs := m.Call([]reflect.Value{}) - if nil != rvs && 1 == len(rvs) && nil != rvs[0].Interface() { - return rvs[0].Interface().(error) + + switch method { + case ServiceMethodInit, ServiceMethodStart: + if nil != rvs && 1 == len(rvs) && nil != rvs[0].Interface() { + return rvs[0].Interface().(error) + } + default: } }