@@ -70,14 +70,15 @@ func Start(targets []string, b backend.Backend) error {
7070
7171 // if target is platform, install all services
7272 if len (targets ) == 1 {
73- if targets [0 ] == PlatformCommand {
73+ switch targets [0 ] {
74+ case PlatformCommand :
7475 return StartPlatform (b , false )
75- } else if targets [ 0 ] == StatelessPlatformCommand {
76+ case StatelessPlatformCommand :
7677 return StartPlatform (b , true )
77- } else if targets [0 ] == swarm {
78- return StartSwarm (b )
79- } else if targets [0 ] == mesos {
78+ case mesos :
8079 return StartMesos (b )
80+ case swarm :
81+ return StartSwarm (b )
8182 }
8283 }
8384 var wg sync.WaitGroup
@@ -170,14 +171,15 @@ func Stop(targets []string, b backend.Backend) error {
170171
171172 // if target is platform, stop all services
172173 if len (targets ) == 1 {
173- if targets [0 ] == PlatformCommand {
174+ switch targets [0 ] {
175+ case PlatformCommand :
174176 return StopPlatform (b , false )
175- } else if targets [ 0 ] == StatelessPlatformCommand {
177+ case StatelessPlatformCommand :
176178 return StopPlatform (b , true )
177- } else if targets [0 ] == swarm {
178- return StopSwarm (b )
179- } else if targets [0 ] == mesos {
179+ case mesos :
180180 return StopMesos (b )
181+ case swarm :
182+ return StopSwarm (b )
181183 }
182184 }
183185
@@ -268,14 +270,15 @@ func Install(targets []string, b backend.Backend, checkKeys func() error) error
268270
269271 // if target is platform, install all services
270272 if len (targets ) == 1 {
271- if targets [0 ] == PlatformCommand {
273+ switch targets [0 ] {
274+ case PlatformCommand :
272275 return InstallPlatform (b , checkKeys , false )
273- } else if targets [ 0 ] == StatelessPlatformCommand {
276+ case StatelessPlatformCommand :
274277 return InstallPlatform (b , checkKeys , true )
275- } else if targets [0 ] == swarm {
276- return InstallSwarm (b )
277- } else if targets [0 ] == mesos {
278+ case mesos :
278279 return InstallMesos (b )
280+ case swarm :
281+ return InstallSwarm (b )
279282 }
280283 }
281284 var wg sync.WaitGroup
@@ -325,14 +328,15 @@ func installDefaultServices(b backend.Backend, stateless bool, wg *sync.WaitGrou
325328// After Uninstall, the components will be unavailable until Install is called.
326329func Uninstall (targets []string , b backend.Backend ) error {
327330 if len (targets ) == 1 {
328- if targets [0 ] == PlatformCommand {
331+ switch targets [0 ] {
332+ case PlatformCommand :
329333 return UninstallPlatform (b , false )
330- } else if targets [ 0 ] == StatelessPlatformCommand {
334+ case StatelessPlatformCommand :
331335 return UninstallPlatform (b , true )
332- } else if targets [0 ] == swarm {
333- return UnInstallSwarm (b )
334- } else if targets [0 ] == mesos {
336+ case mesos :
335337 return UninstallMesos (b )
338+ case swarm :
339+ return UnInstallSwarm (b )
336340 }
337341 }
338342
0 commit comments