Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept config directory from ENV variable #75

Merged
merged 3 commits into from
Mar 25, 2018
Merged

Accept config directory from ENV variable #75

merged 3 commits into from
Mar 25, 2018

Conversation

tsconn23
Copy link
Member

PR for this issue: #26

Signed-off-by: Trevor Conn <trevor_conn@dell.com>
Signed-off-by: Trevor Conn <trevor_conn@dell.com>
contents, err := ioutil.ReadFile(path)
path := determinePath()
fileName := determineConfigFile(profile)
contents, err := ioutil.ReadFile(path + fileName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more self-documenting if we were not to force path ending with /, but rather have here something like: path + "/" + filename

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, this is something I wanted to get feedback on. I don't have a strong preference.

path = configDirectory
}

if path[len(path)-1:] != "/" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe no need to enforce finishing with /. As explained before.

Signed-off-by: Trevor Conn <trevor_conn@dell.com>
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tsconn23 tsconn23 merged commit b1987c6 into edgexfoundry:master Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants