path

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Separator     = '/' // OS-specific path separator
	ListSeparator = ':' // OS-specific path list separator
)

Variables

This section is empty.

Functions

func IsSeparator

func IsSeparator(c uint8) bool

IsSeparator reports whether c is a directory separator character.

func Rel

func Rel(basepath, targpath string) (string, error)

Rel returns a relative path that is lexically equivalent to targpath when joined to basepath with an intervening separator. That is, Join(basepath, Rel(basepath, targpath)) is equivalent to targpath itself. On success, the returned path will always be relative to basepath, even if basepath and targpath share no elements. An error is returned if targpath can't be made relative to basepath or if knowing the current working directory would be necessary to compute it. Rel calls Clean on the result. Code borrowed from path/filpath/path.go

func ResolveReference

func ResolveReference(path_, frombasepath, tobasepath string) string

ResolveReference resolves a path reference to a target base path from a base path. If path_ is not under frombasepath, then ResolveReference ignores frombasepath and return a path under tobasepath.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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