github.com/decred/dcrlnd@v0.7.6/lnrpc/file_utils.go (about)

     1  package lnrpc
     2  
     3  import (
     4  	"os"
     5  )
     6  
     7  // FileExists reports whether the named file or directory exists.
     8  func FileExists(name string) bool {
     9  	if _, err := os.Stat(name); err != nil {
    10  		if os.IsNotExist(err) {
    11  			return false
    12  		}
    13  	}
    14  	return true
    15  }