Versions in this module Expand all Collapse all v0 v0.1.0 Oct 10, 2026 Changes in this version + var ErrClosed = errors.New("gitconfig: file is closed") + var ErrIncludeDepth = errors.New("gitconfig: exceeded maximum include depth") + var ErrInvalidKey = errors.New("gitconfig: invalid key") + var ErrInvalidValue = errors.New("gitconfig: invalid value") + var ErrLoadLimit = errors.New("gitconfig: exceeded load limits") + var ErrLocked = errors.New("gitconfig: config file is locked") + var ErrMultipleValues = errors.New("gitconfig: multiple values") + var ErrNoScope = errors.New("gitconfig: scope not available") + var ErrNotAbsolute = errors.New("gitconfig: path is not absolute") + var ErrNotFound = errors.New("gitconfig: not found") + var ErrNotRegular = errors.New("gitconfig: not a regular file") + var ErrNotRepository = errors.New("gitconfig: not a git repository") + var ErrUntrusted = errors.New(...) + type CommandEntry struct + Implicit bool + Key string + Value string + type Config struct + func (c *Config) All() iter.Seq[Entry] + func (c *Config) Bool(key string, def bool) (bool, error) + func (c *Config) Get(key string) (Entry, bool) + func (c *Config) GetAll(key string) []Entry + func (c *Config) Int(key string, def int64) (int64, error) + func (c *Config) Path(key, home, def string) (string, error) + func (c *Config) Section(section string) iter.Seq[Entry] + func (c *Config) Subsection(section, sub string) iter.Seq[Entry] + func (c *Config) Subsections(section string) []string + func (c *Config) Value(key string, def string) string + type Entry struct + Implicit bool + Key Key + Origin Origin + Value string + func (e Entry) Bool() (bool, error) + func (e Entry) Int() (int64, error) + func (e Entry) Path(home string) (string, error) + type Env struct + Command []CommandEntry + GitDir string + GlobalConfig []string + Home string + SystemConfig string + func Discover(dir string) (Env, error) + func (e Env) Load() (*Config, error) + func (e Env) LoadFile(path string) (*Config, error) + func (e Env) LoadProtected() (*Config, error) + func (e Env) LoadScope(s Scope) (*Config, error) + func (e Env) UpdateFile(path string, fn func(*File) error) error + func (e Env) UpdateScope(s Scope, fn func(*File) error) error + func (e Env) WritePath(s Scope) (string, error) + type EnvError struct + Err error + Var string + func (e *EnvError) Error() string + func (e *EnvError) Unwrap() error + type File struct + func Parse(name string, data []byte) (*File, error) + func (f *File) Add(key, value string) error + func (f *File) Bytes() []byte + func (f *File) Config() *Config + func (f *File) RemoveSection(section string) (removed bool, err error) + func (f *File) RemoveSubsection(section, sub string) (removed bool, err error) + func (f *File) RenameSection(oldName, newName string) error + func (f *File) RenameSubsection(section, oldSub, newSub string) error + func (f *File) ReplaceAll(key, value string) error + func (f *File) Set(key, value string) error + func (f *File) Unset(key string) (removed bool, err error) + func (f *File) UnsetAll(key string) (removed int, err error) + type FileError struct + Err error + Path string + func (e *FileError) Error() string + func (e *FileError) Unwrap() error + type Key struct + HasSubsection bool + Name string + Section string + Subsection string + func ParseKey(s string) (Key, error) + func (k Key) String() string + type KeyError struct + Err error + Key string + func (e *KeyError) Error() string + func (e *KeyError) Unwrap() error + type Origin struct + File string + Line int + Scope Scope + type Scope int + const ScopeCommand + const ScopeFile + const ScopeGlobal + const ScopeLocal + const ScopeSystem + const ScopeWorktree + func (s Scope) String() string + type SyntaxError struct + File string + Line int + Msg string + func (e *SyntaxError) Error() string + type ValueError struct + Entry Entry + Err error + Type string + func (e *ValueError) Error() string + func (e *ValueError) Unwrap() error