FileExists is a wrapper on os.Stat that returns false if os.Stat returns an error, it returns true otherwise. This method does not care if os.Stat returns any other kind of errors.
(path string)
| 27 | // error, it returns true otherwise. This method does not care if os.Stat |
| 28 | // returns any other kind of errors. |
| 29 | func FileExists(path string) bool { |
| 30 | if path == "" { |
| 31 | return false |
| 32 | } |
| 33 | _, err := os.Stat(path) |
| 34 | return err == nil |
| 35 | } |
| 36 | |
| 37 | // ReadAll returns a slice of bytes with the content of the given reader. |
| 38 | func ReadAll(r io.Reader) ([]byte, error) { |
no outgoing calls
searching dependent graphs…