lazy code move from repolist

This commit is contained in:
Jeff Carr 2024-02-22 15:55:16 -06:00
parent da5e5f6455
commit c3c3901e9a
1 changed files with 8 additions and 0 deletions

View File

@ -88,3 +88,11 @@ func Chomp(a interface{}) string {
handleError(fmt.Errorf(tmp), -1)
return ""
}
// this is stuff from a long time ago that there must be a replacement for
func RemoveFirstElement(slice []string) (string, []string) {
if len(slice) == 0 {
return "", slice // Return the original slice if it's empty
}
return slice[0], slice[1:] // Return the slice without the first element
}