diff options
| -rw-r--r-- | chomp.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 +} |
