octolab / cli

💾 Toolkit for command line interfaces.
https://go.octolab.org/toolkit/cli
MIT License
0 stars 0 forks source link

config: compare os.UserHomeDir and github.com/mitchellh/go-homedir, make a decision about integration #7

Open kamilsk opened 3 years ago

kamilsk commented 3 years ago

Motivation: configuration is needed for tools. For example, $HOME/.maintainer.

Research https://github.com/spf13/cobra/commit/8eaca5f0f49ad747a0722d39dca7a75c34abd21a and https://golang.org/pkg/os/#UserHomeDir and compare it with https://github.com/mitchellh/go-homedir.

PoC

config.Load("config.name") // open $HOME/.tool/config.name with fallback to config.name in working directory