Codebase list golang-github-vbauerster-mpb / 2aaf6ca
refactoring: eitherError to firstNonNil Vladimir Bauer 2 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
516516
517517 bufP, bufB, bufA := s.buffers[0], s.buffers[1], s.buffers[2]
518518
519 err := eitherError(decorFiller(bufP, s.pDecorators), decorFiller(bufA, s.aDecorators))
519 err := firstNonNil(decorFiller(bufP, s.pDecorators), decorFiller(bufA, s.aDecorators))
520520 if err != nil {
521521 return nil, err
522522 }
644644 return buf.WriteByte(' ')
645645 }
646646
647 func eitherError(errors ...error) error {
647 func firstNonNil(errors ...error) error {
648648 for _, err := range errors {
649649 if err != nil {
650650 return err