mirror of
https://github.com/rwinkhart/go-boilerplate.git
synced 2026-10-26 21:39:56 -04:00
Bump Go + deps; run go fix
This commit is contained in:
1 parent
f70ff83e1e
commit
ff7e156e91
3 files changed
+11
-9
No files matched your search
+4
-2
@@ -1,9 +1,11 @@
|
||||
package back
|
||||
|
||||
import "slices"
|
||||
|
||||
// RemoveTrailingEmptyStrings removes empty strings from the end of a slice.
|
||||
func RemoveTrailingEmptyStrings(slice []string) []string {
|
||||
for i := len(slice) - 1; i >= 0; i-- {
|
||||
if slice[i] != "" {
|
||||
for i, s := range slices.Backward(slice) {
|
||||
if s != "" {
|
||||
return slice[:i+1]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user