-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Use os.UserHomeDir() for Go version 1.12+ #853
Conversation
👍 |
@mgrachev is there an issue with using the https://github.com/mitchellh/go-homedir package? |
@jharshman No, this is a dependency and I prefer to minimize dependencies in my projects. |
@mgrachev Trimming back dependencies is always good, however, the |
@mgrachev I'm confused about this. How does adding this comment to the source help? Are we expecting users to change their dependency source if they are using Go 1.12+? |
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
@spf13 Yes, you're right. I've added this comment because I didn't want to drop support for previous versions of Go. |
I'm not sure what value there is in adding a comment. I do think there is some value in removing dependencies. One way to do this without breaking older users of Go is to incorporate build tags. |
@spf13 Done. |
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
I'm going to close this because it introduces complication without enough benefit. |
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
…spf13#774) fix: root.go.golden and tpl/main.go
Commenting on a closed PR is pretty bad form, but |
Looks like this has been done by #1337 and released in Cobra 1.2. |
Hi there!
Use
os.UserHomeDir()
instead ofgo-homedir
for Go version 1.12+.