Documentation
¶
Index ¶
- func Add(add string, sys bool) error
- func ApplyClean(newPath string, sys bool) error
- func QuerySystemPath() ([]string, error)
- func QueryUserPath() ([]string, error)
- func Remove(remove string, sys bool) error
- func RemoveInvalidPaths(paths []InvalidPath, sys bool) error
- func SearchSystemPath(keyword string) ([]string, error)
- func SearchUserPath(keyword string) ([]string, error)
- type CleanResult
- type InvalidPath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add adds a path to the PATH environment variable. If sys is true, modifies system PATH; otherwise modifies user PATH. Note: setx has a 1024 character limit, so PowerShell is used instead.
func ApplyClean ¶
ApplyClean applies the cleaned PATH to the registry.
func QuerySystemPath ¶
QuerySystemPath queries the system PATH environment variable from registry.
func QueryUserPath ¶
QueryUserPath queries the user's PATH environment variable from registry.
func RemoveInvalidPaths ¶
func RemoveInvalidPaths(paths []InvalidPath, sys bool) error
RemoveInvalidPaths removes specified invalid paths from PATH.
func SearchSystemPath ¶
SearchSystemPath searches system PATH for entries containing keyword (case-insensitive).
func SearchUserPath ¶
SearchUserPath searches user PATH for entries containing keyword (case-insensitive).
Types ¶
type CleanResult ¶
CleanResult contains the preview of paths to be cleaned.
func PreviewClean ¶
func PreviewClean(sys bool) (CleanResult, error)
PreviewClean analyzes PATH and returns what would be cleaned.
type InvalidPath ¶
InvalidPath represents an invalid path entry with its index.
func Check ¶
func Check(sys bool) ([]InvalidPath, error)
Check finds invalid paths in PATH that don't exist on filesystem.