Simple and opinionated home config, data, and cache directories
Find a file
2026-04-06 18:37:32 -06:00
.github/workflows unexport and constrain platform specific layouts 2024-04-11 17:58:49 -06:00
.gitignore unexport and constrain platform specific layouts 2024-04-11 17:58:49 -06:00
dirs.go Specific unique applicaiton directories on windows 2024-04-11 18:25:43 -06:00
dirs_darwin.go Specific unique applicaiton directories on windows 2024-04-11 18:25:43 -06:00
dirs_darwin_test.go Specific unique applicaiton directories on windows 2024-04-11 18:25:43 -06:00
dirs_test.go unexport and constrain platform specific layouts 2024-04-11 17:58:49 -06:00
dirs_unix.go unexport and constrain platform specific layouts 2024-04-11 17:58:49 -06:00
dirs_unix_nodarwin.go Specific unique applicaiton directories on windows 2024-04-11 18:25:43 -06:00
dirs_unix_test.go unexport and constrain platform specific layouts 2024-04-11 17:58:49 -06:00
dirs_windows.go Specific unique applicaiton directories on windows 2024-04-11 18:25:43 -06:00
dirs_windows_test.go Specific unique applicaiton directories on windows 2024-04-11 18:25:43 -06:00
doc.go Specific unique applicaiton directories on windows 2024-04-11 18:25:43 -06:00
go.mod chore: update mod -> nemith.io/dothome 2026-04-06 18:37:32 -06:00
go.sum initial commit 2024-04-11 16:57:34 -06:00
LICENSE initial commit 2024-04-11 16:57:34 -06:00
README.md initial commit 2024-04-11 16:57:34 -06:00

dothome

Go Reference

dothome is a Go library for dealing with configuration, cache, and data directories in a users home directory on various platforms.

It was highly inspired by Rust's etcetera where you can choose to override the native specification on Apple to use an XDG layout instead. This was to be nicer to users running CLI apps who don't want their config files burried a pile of plists in a $HOME/Library/Preferences and prefer something like .config/myapp/myapp.conf.

Basic Usage

import "github.com/nemith/dothome"

layout, err := dothome.CLIAppLayout(dothome.AppConfig{Name: "foo"})
if err != nil {
    panic(err)
}
fmt.Println(layout.ConfigDir)
// Output: /home/user/.config/foo