From 098c12dfda32450519b3b4fe2d83d8a80b93e444 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Sat, 15 Aug 2015 19:30:15 +0100 Subject: [PATCH] Enable/Disable services based on API key existence --- main.go | 4 ++-- service.go | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index 0340d2a..9b0f445 100644 --- a/main.go +++ b/main.go @@ -140,7 +140,7 @@ func CheckAPIKeys() { fmt.Printf("The youtube service has been disabled as you do not have a YouTube API key defined in your environment variables.\n" + "Please see the following link for info on how to fix this: https://github.com/matthieugrieger/mumbledj#youtube-api-keys\n") } else { - AddService(YouTube{}) + services = append(services, YouTube{}) } // Checks Soundcloud API key @@ -148,7 +148,7 @@ func CheckAPIKeys() { fmt.Printf("The soundcloud service has been disabled as you do not have a Soundcloud API key defined in your environment variables.\n" + "Please see the following link for info on how to fix this: https://github.com/matthieugrieger/mumbledj#soundcloud-api-keys\n") } else { - AddService(SoundCloud{}) + services = append(services, SoundCloud{}) } } diff --git a/service.go b/service.go index 78ae1bc..8af34f6 100644 --- a/service.go +++ b/service.go @@ -54,14 +54,6 @@ type Playlist interface { var services []Service -func AddService(service Service) { - if services == nil { - service = Service{service} - } else { - service = append(service, services) - } -} - func findServiceAndAdd(user *gumble.User, url string) error { var urlService Service