home

package
v0.0.0-...-5f25c38 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(path string, homeDirectoryPath ...string) (string, error)

Expand takes a path as input and replaces ~ at the start of the path with the user's home directory. Does nothing if the path does not start with '~'.

Types

type PathCompactor

type PathCompactor struct {
	HomePath string
}

func NewPathCompactor

func NewPathCompactor() *PathCompactor

func (*PathCompactor) Compact

func (pc *PathCompactor) Compact(path string) string

type PathExpander

type PathExpander struct {
	// contains filtered or unexported fields
}

func NewPathExpander

func NewPathExpander(homePath ...string) *PathExpander

func (*PathExpander) Expand

func (pe *PathExpander) Expand(path string) (string, error)

func (*PathExpander) GetHomePath

func (pe *PathExpander) GetHomePath() string

func (*PathExpander) HomeDirectory

func (pe *PathExpander) HomeDirectory() (string, error)

func (*PathExpander) SetHomePath

func (pe *PathExpander) SetHomePath(path string) *PathExpander

Jump to

Keyboard shortcuts

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