Skip to content
Myr

refactor: avoid calling strings.ToLower twice (#3433)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by lgbgbl · committed by GitHub · parent 2285aa5 · Browse files · 1 file+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:recovery.go+3 added-1 removed
60 unmodified lines
61 var brokenPipe bool62 if ne, ok := err.(*net.OpError); ok {63 var se *os.SyscallError64 if errors.As(ne, &se) {65 if strings.Contains(strings.ToLower(se.Error()), "broken pipe") || strings.Contains(strings.ToLower(se.Error()), "connection reset by peer") {65 seStr := strings.ToLower(se.Error())66 if strings.Contains(seStr, "broken pipe") ||67 strings.Contains(seStr, "connection reset by peer") {68 brokenPipe = true69 }70 }71 }
103 unmodified lines