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.
func (PathPrefixer) PrefixPath ¶
func (p PathPrefixer) PrefixPath(path string) string
PrefixPath prefixes the given path with the configured workspace.