ReadFileAbs reads the content of the file with the given file path by resolving it as an absolute path
(relpath string)
| 26 | // ReadFileAbs reads the content of the file with the given file path by resolving |
| 27 | // it as an absolute path |
| 28 | func ReadFileAbs(relpath string) []byte { |
| 29 | fp, err := filepath.Abs(relpath) |
| 30 | if err != nil { |
| 31 | panic(err) |
| 32 | } |
| 33 | |
| 34 | b, err := os.ReadFile(fp) |
| 35 | if err != nil { |
| 36 | panic(err) |
| 37 | } |
| 38 | |
| 39 | return b |
| 40 | } |
| 41 | |
| 42 | // FileExists checks if the file exists at the given path |
| 43 | func FileExists(filepath string) (bool, error) { |
no outgoing calls