Codebase list golang-github-vbauerster-mpb / 4f0b214
inline bytes.Split Vladimir Bauer 4 years ago
1 changed file(s) with 2 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
8787 strings.Repeat("=", total-till-1),
8888 )
8989
90 got := string(getLastLine(buf.Bytes()))
90 got := string(bytes.Split(buf.Bytes(), []byte("\n"))[0])
9191
9292 if !strings.Contains(got, wantBar) {
9393 t.Errorf("Want bar: %q, got bar: %q\n", wantBar, got)
140140 string(runes[2]),
141141 string(runes[4]),
142142 )
143 got := string(getLastLine(buf.Bytes()))
143 got := string(bytes.Split(buf.Bytes(), []byte("\n"))[0])
144144
145145 if !strings.Contains(got, wantBar) {
146146 t.Errorf("Want bar: %q:%d, got bar: %q:%d\n", wantBar, utf8.RuneCountInString(wantBar), got, utf8.RuneCountInString(got))
283283 return ""
284284 })
285285 }
286
287 func getLastLine(bb []byte) []byte {
288 split := bytes.Split(bb, []byte("\n"))
289 return split[len(split)-2]
290 }