filepathext

package
v1.47.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package filepathext provides filepath utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RealClean

func RealClean(path string) (string, error)

RealClean does filepath.Clean and filepath.FromSlash, but also handles ..'s in relative paths relative to the current working directory.

As an example, if we are in proto, and we pass in ../proto/foo, RealClean will return foo.

func Walk

func Walk(walkPath string, walkFunc filepath.WalkFunc, options ...WalkOption) (retErr error)

Walk walks the walkPath.

This is analogous to filepath.Walk, but optionally follows symlinks.

Types

type WalkOption

type WalkOption func(*walkOptions)

WalkOption is an option for Walk.

func WalkWithSymlinks() WalkOption

WalkWithSymlinks returns a WalkOption that results in Walk following symlinks.

Jump to

Keyboard shortcuts

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