summaryrefslogtreecommitdiff
path: root/chomp.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-22 15:55:16 -0600
committerJeff Carr <[email protected]>2024-02-22 15:55:16 -0600
commitc3c3901e9a713bbc6ab6c82a0f19f1f798461179 (patch)
treeb48be0a00c542ff0d0b1b1e70e8b46cce15c26db /chomp.go
parentda5e5f64555dc38a07b4d01665747dee91d1a82a (diff)
lazy code move from repolistv0.21.0v0.20.9
Diffstat (limited to 'chomp.go')
-rw-r--r--chomp.go8
1 files changed, 8 insertions, 0 deletions
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
+}