Skip to content

Commit

Permalink
func comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mfleader committed Jan 5, 2024
1 parent adf9494 commit b5d9976
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/arcaflow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Options:
RequiredFileKeyWorkflow: workflowFile,
}

requiredFilesAbsPaths, err := loadfile.ContextAbsFilepaths(dir, requiredFiles)
requiredFilesAbsPaths, err := loadfile.AbsPathsWithContext(dir, requiredFiles)
if err != nil {
flag.Usage()
tempLogger.Errorf("Failed to determine absolute path of arcaflow context directory %s (%v)", dir, err)
Expand Down
8 changes: 4 additions & 4 deletions loadfile/loadfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"path/filepath"
)

// LoadContext reads the contents at each file into a map where the key
// is the absolute filepath and file contents is the value.
// LoadContext reads the content of each file into a map where the key
// is the absolute filepath and the file content is the value.
func LoadContext(neededFilepaths []string) (map[string][]byte, error) {
result := map[string][]byte{}
var err error
Expand All @@ -27,10 +27,10 @@ func LoadContext(neededFilepaths []string) (map[string][]byte, error) {
return result, err
}

// ContextAbsFilepaths creates a map of absolute filepaths. If a required
// AbsPathsWithContext creates a map of absolute filepaths. If a required
// file is not provided with an absolute path, then it is joined with the
// root directory.
func ContextAbsFilepaths(rootDir string, requiredFiles map[string]string) (map[string]string, error) {
func AbsPathsWithContext(rootDir string, requiredFiles map[string]string) (map[string]string, error) {
absDir, err := filepath.Abs(rootDir)
if err != nil {
return nil, fmt.Errorf("error determining context directory absolute path %s (%w)", rootDir, err)
Expand Down
4 changes: 2 additions & 2 deletions loadfile/loadfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestLoadContext(t *testing.T) {
})
}

// This tests ContextAbsFilepaths joins relative paths with the
// This tests AbsPathsWithContext joins relative paths with the
// context (root) directory, and passes through absolute paths
// unmodified.
func TestContextAbsFilepaths(t *testing.T) {
Expand All @@ -98,7 +98,7 @@ func TestContextAbsFilepaths(t *testing.T) {
"c": filepath.Join(testdir, testFilepaths["c"]),
}

absPathsGot, err := loadfile.ContextAbsFilepaths(testdir, testFilepaths)
absPathsGot, err := loadfile.AbsPathsWithContext(testdir, testFilepaths)
assert.NoError(t, err)
assert.Equals(t, absPathsExp, absPathsGot)

Expand Down

0 comments on commit b5d9976

Please sign in to comment.