From 255fecb4f4b8bc06a9860688fb674a22f1c9b2f3 Mon Sep 17 00:00:00 2001 From: ben-toogood Date: Thu, 24 Sep 2020 16:46:23 +0100 Subject: [PATCH] runtime: minor fixes for local runtime (#2019) --- runtime/local/local.go | 4 ++-- runtime/runtime.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/local/local.go b/runtime/local/local.go index 9dfcab45..fd2c3ef7 100644 --- a/runtime/local/local.go +++ b/runtime/local/local.go @@ -18,7 +18,7 @@ import ( ) // defaultNamespace to use if not provided as an option -const defaultNamespace = "default" +const defaultNamespace = "micro" var ( // The directory for logs to be output @@ -313,7 +313,7 @@ func (r *localRuntime) Create(s *runtime.Service, opts ...runtime.CreateOption) r.namespaces[options.Namespace] = make(map[string]*service) } if _, ok := r.namespaces[options.Namespace][serviceKey(s)]; ok { - return errors.New("service already running") + return runtime.ErrAlreadyExists } // create new service diff --git a/runtime/runtime.go b/runtime/runtime.go index e8c6f914..4e331443 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -8,6 +8,7 @@ import ( var ( ErrAlreadyExists = errors.New("already exists") + ErrNotFound = errors.New("not found") ) // Runtime is a service runtime manager