Remove Slice Ranges with slices.Delete in Go
slices.Delete removes one contiguous range from a slice and shifts the remaining suffix toward the front. The operation modifies the supplied backing storage, so its returned slice header is part of the result rather than an optional convenience. Its signature accepts any slice element type: func Delete[S ~[]E, E any](s S, i, j int) S The half-open interval s[i:j] follows ordinary Go slicing rules. Elements at indices from i through j-1 are removed, while elements before i retain their positions.