pathtranslator

package
v0.0.0-...-4c64f06 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package pathtranslator provides path translation functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryRelToAbs

func BinaryRelToAbs(relPath string) (string, error)

BinaryRelToAbs converts a path that is relative to the current executable to an absolute path. If the executable is a symlink then the symlink is resolved before generating the path. If the input path is already an absolute path, just return it.

func ListRelToExecRoot

func ListRelToExecRoot(execRoot, workingDir string, paths []string) []string

ListRelToExecRoot converts a list of paths that are either relative to workingDir or absolute, to paths relative to execRoot. workingDir is relative to execRoot. A path will be ignored if path is not relative to execRoot. Output path is operating system defined file path.

func ListRelToWorkingDir

func ListRelToWorkingDir(execRoot, workingDir string, paths []string) []string

ListRelToWorkingDir converts a list of paths that are either relative to the execroot or absolute, to paths relative to the workingDir. Output path is operating system defined file path.

func RelToExecRoot

func RelToExecRoot(execRoot, workingDir, p string) string

RelToExecRoot converts a path that is either relative to workingDir or absolute, to a path relative to execRoot. workingDir is relative to execRoot. It returns empty string if path is not relative to execRoot. Output path is operating system defined file path.

func RelToWorkingDir

func RelToWorkingDir(execRoot, workingDir, p string) string

RelToWorkingDir converts a path that is either relative to the execroot or absolute, to a path relative to the workingDir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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