Something went wrong. Try again.
Simple and opinionated home config, data, and cache directories
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637// Package path implements basic utilities for determining special applciation// paths in a users home directory.//// This is essentiall an extension of [os.UserHomeDir], [os.UserConfigDir], and// [os.UserCacheDir] functions.//// The main entry point to this package is the [NativeLayout] or [CLILayout]// functions and the application configured versions: [NativeAppLayout] and// [CLIAppLayout].//// [NativeLayout] returns a [Layout] object that uses the native OS paths for// directory paths while [CLILayout] follows the same except on Apple where is// chooses the a XDG layout (same as other unix systems).
// The, opinionated, idea is that CLI applications have files that are meant to// be dealt with directly by users and discovery and editing of these files// should be just like any other unix system. You may not like this and that is// ok, just use [NativeLayout].//// layout, err := dothome.CLILayout()// if err != nil {// log.Fatal(err)// }// fmt.Println(layout.ConfigDir)// // Output: /home/user/.config//// Example with application configuration applied://// appcfg := dothome.AppConfig{Name: "MyApp"}// layout, err := dothome.CLIAppLayout(appcfg)// if err != nil {// log.Fatal(err)// }// fmt.Println(layout.ConfigDir)// // Output: /home/user/.config/myapppackage dothome