GetFile is a convenience method to get the contents of a file in the repo.
(filename string)
| 9 | |
| 10 | // GetFile is a convenience method to get the contents of a file in the repo. |
| 11 | func (r *Repository) GetFile(filename string) ([]byte, error) { |
| 12 | f, err := r.WorktreeFS.Open(filename) |
| 13 | if err != nil { |
| 14 | return nil, err |
| 15 | } |
| 16 | |
| 17 | return io.ReadAll(f) |
| 18 | } |
| 19 | |
| 20 | // FileExists returns true if the given path exists and is a regular file in the |
| 21 | // repository worktree. |
no outgoing calls
no test coverage detected