Skip to content

Commit

Permalink
OpenFileOrUrl: Clarifying purpose and error handling of ParsePathSpec…
Browse files Browse the repository at this point in the history
… call
  • Loading branch information
Lucas Hinderberger committed Jun 17, 2024
1 parent 8fa7163 commit beb5c40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/lib/util/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ var c = &http.Client{

// OpenFileOrUrl opens either a local file or gives the resp.Body from a remote file
func OpenFileOrUrl(path, rootDir string) (string, io.ReadCloser, error) {
// Note that err is not propagated here since we're only checking
// *if* path is an @-Notation PathSpec. If so, we unwrap its path.
// If not, we assume we don't have an @-Notation at hand in the first place.
// Validation of PathSpec is performed further up in calling code.
pathSpec, err := ParsePathSpec(path)
if err == nil {
path = pathSpec.Path
Expand Down

0 comments on commit beb5c40

Please sign in to comment.