github.com/GuanceCloud/cliutils@v1.1.21/pprofparser/tools/filepathtoolkit/stat.go (about)

     1  package filepathtoolkit
     2  
     3  import (
     4  	"errors"
     5  	"os"
     6  )
     7  
     8  func FileExists(path string) bool {
     9  	_, err := os.Stat(path)
    10  	if err != nil && errors.Is(err, os.ErrNotExist) {
    11  		return false
    12  	}
    13  	return true
    14  }