From 9cdaf9851c4d2bcc119952cc1eef831253ad290b Mon Sep 17 00:00:00 2001 From: Superredstone Date: Sun, 15 Feb 2026 17:25:55 +0100 Subject: [PATCH] style: move services into separated file --- lib/download.go | 15 --------------- lib/services.go | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/download.go b/lib/download.go index b5aac7e..10e4558 100644 --- a/lib/download.go +++ b/lib/download.go @@ -11,21 +11,6 @@ const ( DEFAULT_DOWNLOAD_OUTPUT_FOLDER = "." ) -type AvailableServices int - -const ( - AvailableServicesTidal = iota -) - -func ParseAvailableServices(service string) (AvailableServices, error) { - switch service { - case "tidal": - return AvailableServicesTidal, nil - break - } - return AvailableServicesTidal, errors.New("Invalid service.") -} - type DownloadRequest struct { Service AvailableServices } diff --git a/lib/services.go b/lib/services.go index 55c21f8..de53e9e 100644 --- a/lib/services.go +++ b/lib/services.go @@ -1 +1,18 @@ package lib + +import "errors" + +type AvailableServices int + +const ( + AvailableServicesTidal = iota +) + +func ParseAvailableServices(service string) (AvailableServices, error) { + switch service { + case "tidal": + return AvailableServicesTidal, nil + } + return AvailableServicesTidal, errors.New("Invalid service.") +} +