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

Search up parent directories until we find our files. #166

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cdignam-segment
Copy link

Fixes #165

@MichaelHindley
Copy link

Any chance of this being merged @alexandear @joho @gnarlex ? It's great for projects with many packages :)

Comment on lines +33 to +39
func stringSet(s []string) map[string]interface{} {
m := make(map[string]interface{})
for _, str := range s {
m[str] = true
}
return m
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change a little bit the method? map[string]struct{} is a common way for implementing set in Go:

Suggested change
func stringSet(s []string) map[string]interface{} {
m := make(map[string]interface{})
for _, str := range s {
m[str] = true
}
return m
}
func stringSet(s []string) map[string]struct{} {
m := make(map[string]struct{}, len(s))
for _, str := range s {
m[str] = struct{}{}
}
return m
}

@alexandear
Copy link
Contributor

I'm not a maintainer of the repo. Sorry, can't merge.

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.

dotenv should look up in parent directories for .env
3 participants