Codebase list golang-github-vbauerster-mpb / c778e9f
ignore error in example/bench tests Vladimir Bauer 4 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1717 func BenchmarkWithJoin(b *testing.B) {
1818 bCuuAndEd := [][]byte{[]byte("\x1b["), []byte("A\x1b[J")}
1919 for i := 0; i < b.N; i++ {
20 ioutil.Discard.Write(bytes.Join(bCuuAndEd, []byte(strconv.Itoa(4))))
20 _, _ = ioutil.Discard.Write(bytes.Join(bCuuAndEd, []byte(strconv.Itoa(4))))
2121 }
2222 }
2323
2525 escOpen := []byte("\x1b[")
2626 cuuAndEd := []byte("A\x1b[J")
2727 for i := 0; i < b.N; i++ {
28 ioutil.Discard.Write(append(strconv.AppendInt(escOpen, 4, 10), cuuAndEd...))
28 _, _ = ioutil.Discard.Write(append(strconv.AppendInt(escOpen, 4, 10), cuuAndEd...))
2929 }
3030 }
3131
3333 w := New(ioutil.Discard)
3434 w.lines = 4
3535 for i := 0; i < b.N; i++ {
36 w.ansiCuuAndEd()
36 _ = w.ansiCuuAndEd()
3737 }
3838 }
7777 defer proxyReader.Close()
7878
7979 // and copy from reader, ignoring errors
80 io.Copy(ioutil.Discard, proxyReader)
80 _, _ = io.Copy(ioutil.Discard, proxyReader)
8181
8282 p.Wait()
8383 }