On this page
Creates the howmuchleft config file when it is missing and fills in any setting a newer version added, leaving existing values and comments untouched.
#internal/migrate
#internal/migrate
Package migrate brings the on-disk howmuchleft config up to the shape the current binary expects: it creates ~/.config/howmuchleft/config.toml when it is missing, and fills in any key a newer version introduced. Existing values, comments and formatting are never touched, and unknown keys are left alone.
The defaults it writes come from internal/config, which is the single source of truth -- a new setting becomes part of the seeded file the moment it is added to config.Default() or config.DefaultLines().
#Result
type Result structResult reports what EnsureDefaults did to the config file.
#EnsureDefaults
func EnsureDefaults(configDir string) (*Result, error)EnsureDefaults creates or completes the config file in configDir. It is idempotent: when nothing is missing, the file is not rewritten at all.