From 525776295455b2b35c5c4b21b3b22bca4811a4b5 Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Wed, 27 Nov 2024 23:43:17 -0800 Subject: [PATCH] Return the entire input string if cannot extract device name --- smartctl.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smartctl.go b/smartctl.go index 472cd01..5d5a936 100644 --- a/smartctl.go +++ b/smartctl.go @@ -63,7 +63,9 @@ func extractDiskName(input string) string { return strings.Join(name, "_") } - return "" + + // If the regex doesn't match, return the entire input string + return input } // NewSMARTctl is smartctl constructor