summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
+}