From c3c3901e9a713bbc6ab6c82a0f19f1f798461179 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 22 Feb 2024 15:55:16 -0600 Subject: [PATCH] lazy code move from repolist --- chomp.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chomp.go b/chomp.go index db37ecb..19acaf7 100644 --- a/chomp.go +++ b/chomp.go @@ -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 +}