Skip to content

Commit

Permalink
Return the entire input string if cannot extract device name
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z committed Nov 28, 2024
1 parent fdfec20 commit 5257762
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion smartctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5257762

Please sign in to comment.