Slice slices the view between the provided from and to indices.
(from, to int)
| 69 | |
| 70 | // Slice slices the view between the provided from and to indices. |
| 71 | func (v ByteView) Slice(from, to int) ByteView { |
| 72 | if v.b != nil { |
| 73 | return ByteView{b: v.b[from:to]} |
| 74 | } |
| 75 | return ByteView{s: v.s[from:to]} |
| 76 | } |
| 77 | |
| 78 | // SliceFrom slices the view from the provided index until the end. |
| 79 | func (v ByteView) SliceFrom(from int) ByteView { |
no outgoing calls