Skip to content

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