On Sun, Oct 16, 2016 at 1:49 PM, Liam <networkimp...@gmail.com> wrote:
>
> A function to insert a byte into a slice is conspicuous by its absence.

It's a one-liner.
    append(s[:p], append([]byte{b}, s[p:]...)...)
(You may want to look at https://github.com/golang/go/wiki/SliceTricks).


>         // but instead it's gobbledygook:

In particular cases where the one-liner is goobledygook, it's easy
enough to write a helper function yourself.

To argue that this should go into the standard library, look at some
corpus of Go code and find out how often it occurs.  If it occurs
fairly often, you've got a good case.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to