diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-09-15 08:51:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-15 08:51:46 -0400 |
commit | 2628022275ef64fde95545abe4634b4bd7177844 (patch) | |
tree | 25d451b81d720f44aa09b20389be7fbb75b7864e /plugin/pluginenv | |
parent | 2a6cd44f23e1b3207debaa73801f0c63a2c81126 (diff) | |
download | chat-2628022275ef64fde95545abe4634b4bd7177844.tar.gz chat-2628022275ef64fde95545abe4634b4bd7177844.tar.bz2 chat-2628022275ef64fde95545abe4634b4bd7177844.zip |
PLT-7622 Improvements to server handling of webapp plugins (#7445)
* Improvements to server handling of webapp plugins
* Fix newline
* Update manifest function names
Diffstat (limited to 'plugin/pluginenv')
-rw-r--r-- | plugin/pluginenv/environment.go | 4 | ||||
-rw-r--r-- | plugin/pluginenv/environment_test.go | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/plugin/pluginenv/environment.go b/plugin/pluginenv/environment.go index e4a7f1b3b..805b33e66 100644 --- a/plugin/pluginenv/environment.go +++ b/plugin/pluginenv/environment.go @@ -66,7 +66,7 @@ func (env *Environment) Plugins() ([]*model.BundleInfo, error) { } // Returns a list of all currently active plugins within the environment. -func (env *Environment) ActivePlugins() ([]*model.BundleInfo, error) { +func (env *Environment) ActivePlugins() []*model.BundleInfo { env.mutex.RLock() defer env.mutex.RUnlock() @@ -75,7 +75,7 @@ func (env *Environment) ActivePlugins() ([]*model.BundleInfo, error) { activePlugins = append(activePlugins, p.BundleInfo) } - return activePlugins, nil + return activePlugins } // Returns the ids of the currently active plugins. diff --git a/plugin/pluginenv/environment_test.go b/plugin/pluginenv/environment_test.go index f24ef8d3d..c11644b35 100644 --- a/plugin/pluginenv/environment_test.go +++ b/plugin/pluginenv/environment_test.go @@ -127,8 +127,7 @@ func TestEnvironment(t *testing.T) { assert.NoError(t, err) assert.Len(t, plugins, 3) - activePlugins, err := env.ActivePlugins() - assert.NoError(t, err) + activePlugins := env.ActivePlugins() assert.Len(t, activePlugins, 0) assert.Error(t, env.ActivatePlugin("x")) @@ -150,8 +149,7 @@ func TestEnvironment(t *testing.T) { assert.NoError(t, env.ActivatePlugin("foo")) assert.Equal(t, env.ActivePluginIds(), []string{"foo"}) - activePlugins, err = env.ActivePlugins() - assert.NoError(t, err) + activePlugins = env.ActivePlugins() assert.Len(t, activePlugins, 1) assert.Error(t, env.ActivatePlugin("foo")) |