Skip to content

Commit

Permalink
Adding godoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Apr 20, 2021
1 parent d87e426 commit 1ea625d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/go/internal/pkgpath/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ import (
"gopkg.in/yaml.v3"
)

// File represents a file in the package.
type File struct {
os.FileInfo
}

// Files finds files for the given glob
func Files(glob string) ([]File, error) {
paths, err := filepath.Glob(glob)
if err != nil {
Expand All @@ -43,6 +45,9 @@ func Files(glob string) ([]File, error) {
return files, errs.Err()
}

// Values returns values within the file matching the given path. Paths
// should be expressed using JSONPath syntax. This method is only supported
// for YAML and JSON files.
func (f File) Values(path string) (interface{}, error) {
fileName := f.Name()
fileExt := filepath.Ext(fileName)
Expand Down

0 comments on commit 1ea625d

Please sign in to comment.