optimize: change err == xx to errors.Is(err, xx) (#3991)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"os"
|
||||
@@ -86,7 +87,7 @@ func findPbFile(current string, src string, grpc bool) (string, error) {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err == os.ErrExist {
|
||||
if errors.Is(err, os.ErrExist) {
|
||||
return filepath.Dir(filepath.Join(current, ret)), nil
|
||||
}
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user