pathutil

package
v1.18.13 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 1 Imported by: 2

Documentation

Overview

Provides utility functions for working with file paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(path string) string

Dir returns all but the last element of path, typically the path's directory.

  • path is the path to be split.

func Join

func Join(elem ...string) string

Join joins any number of path elements into a single path, separating them with slash. Empty elements are ignored. The result is Cleaned. However, if the argument list is empty or all its elements are empty, Join returns an empty string.

func Split

func Split(path string) (dir, file string)

Split splits path immediately following the final Separator, separating it into a directory and file name component. If there is no Separator in path, Split returns an empty dir and file set to path. The returned values have the property that path = dir+file.

  • path is the path to be split.

Types

This section is empty.

Jump to

Keyboard shortcuts

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