Documentation ¶
Overview ¶
Package pathprefix is used to print correct filepaths for a configured workspace.
The default workspace is the current working directory. Users may override the default workspace using the --workspace flag.
The functions defined here should be used when printing any filepath to the user, as they might otherwise be incorrect if the user has changed the workspace.
The prefixer MUST not be used when accessing files, as the workspace is changed using os.Chdir() before the command is executed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathPrefixer ¶
type PathPrefixer struct {
// contains filtered or unexported fields
}
PathPrefixer is used to prefix paths with the configured workspace for printing.
func (PathPrefixer) PrefixPrintablePath ¶ added in v2.10.1
func (p PathPrefixer) PrefixPrintablePath(path string) string
PrefixPrintablePath prefixes the given path with the configured workspace for printing. This function MUST not be used when accessing files. This function SHOULD be used when printing paths to the user.