NewConfig provides a configuration with default values.
()
| 31 | |
| 32 | // NewConfig provides a configuration with default values. |
| 33 | func NewConfig() Config { |
| 34 | home := userHome() |
| 35 | dir := Dir() |
| 36 | |
| 37 | return Config{ |
| 38 | OS: runtime.GOOS, |
| 39 | Dir: Dir(), |
| 40 | Home: home, |
| 41 | DefaultBaseURL: defaultBaseURL, |
| 42 | DefaultDirName: DefaultDirName, |
| 43 | Persister: FilePersister{Dir: dir}, |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // SetDefaultDirName configures the default directory name based on the name of the binary. |
| 48 | func SetDefaultDirName(binaryName string) { |
no test coverage detected