Help us shape the future of Go! Take the 2026 Go Developer Survey

userdirs

package
v0.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package userdirs resolves the directories that hold codegraph's per-user files, following the XDG Base Directory layout on every platform: state under XDG_STATE_HOME (default ~/.local/state) and configuration under XDG_CONFIG_HOME (default ~/.config). Nothing codegraph owns lives under ~/.codegraph: that name is the per-repository index marker, and a directory of that name in the home directory would be taken for an index.

The functions only resolve paths. Whoever writes a file creates the directory it needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the per-user configuration directory: $XDG_CONFIG_HOME/codegraph when XDG_CONFIG_HOME is an absolute path, otherwise <home>/.config/codegraph.

func StateDir

func StateDir() (string, error)

StateDir returns the per-user state directory: $XDG_STATE_HOME/codegraph when XDG_STATE_HOME is an absolute path, otherwise <home>/.local/state/codegraph.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL