Codebase list golang-github-vbauerster-mpb / c1e017a
move getLastLine func to where it's used Vladimir Bauer 4 years ago
2 changed file(s) with 5 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
287287 return ""
288288 })
289289 }
290
291 func getLastLine(bb []byte) []byte {
292 split := bytes.Split(bb, []byte("\n"))
293 return split[len(split)-2]
294 }
00 package mpb_test
11
22 import (
3 "bytes"
43 "context"
54 "io/ioutil"
65 "math/rand"
188187 }
189188 }
190189
191 func getLastLine(bb []byte) []byte {
192 split := bytes.Split(bb, []byte("\n"))
193 return split[len(split)-2]
194 }
195
196190 func randomDuration(max time.Duration) time.Duration {
197191 return time.Duration(rand.Intn(10)+1) * max / 10
198192 }