relpath

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolved

type Resolved struct {
	// Path to file or directory.
	Path string

	// Path in which relative paths are contained.
	Base string

	// Base-relative path to file or directory. May contain ".." elements.
	Relative string

	// Elements of base-relative path. May contain "..".
	RelativeElems []string
}

func Resolve

func Resolve(base, path string) (Resolved, error)

Resolve the path relative to base. Path may be absolute.

func (Resolved) Contained

func (r Resolved) Contained() bool

Contained determines whether the path is fully contained within the base directory.

Jump to

Keyboard shortcuts

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