optimize: change err == xx to errors.Is(err, xx) (#3991)

This commit is contained in:
mongobaba
2024-03-09 20:49:16 +08:00
committed by GitHub
parent e9e55125a9
commit 459d3025c5
5 changed files with 8 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ func formatError(err error) string {
}
switch {
case err == io.EOF:
case errors.Is(err, io.EOF):
return "eof"
case errors.Is(err, context.DeadlineExceeded):
return "context deadline"