chore: make cpu usage more smooth (#3842)

This commit is contained in:
Kevin Wan
2024-01-13 19:36:25 +08:00
committed by GitHub
parent 7ba8adfc74
commit 81d72b5010
5 changed files with 11 additions and 6 deletions

View File

@@ -651,7 +651,7 @@ func NewScanner(filename string, src interface{}) (*Scanner, error) {
}
func readData(filename string, src interface{}) ([]byte, error) {
if strings.HasSuffix(filename, ".api") &&pathx.FileExists(filename){
if strings.HasSuffix(filename, ".api") && pathx.FileExists(filename) {
data, err := os.ReadFile(filename)
if err != nil {
return nil, err