path

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package path contains utilities for manipulating file paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base added in v0.4.0

func Base(path string) string

Base is a wrapper around filepath.Base.

func Clean added in v0.2.0

func Clean(p string) string

Clean is a wrapper around filepath.Clean.

func Dir added in v0.3.0

func Dir(path string) string

Dir is a wrapper around filepath.Dir.

func Expand added in v0.2.0

func Expand(path string) (string, error)

Expand expands absolute directory in file paths.

func Ext added in v0.4.0

func Ext(path string) string

Ext is a wrapper around filepath.Ext.

func Home added in v0.2.0

func Home() string

Home returns the home directory of the current user or a temporary directory.

func Join

func Join(elem ...string) string

Join is a wrapper around filepath.Join.

func OnlyName added in v0.4.0

func OnlyName(path string) string

OnlyName returns the file name without extension.

func RelFromHome added in v0.2.0

func RelFromHome(target string) string

RelFromHome returns a path relative to the home directory. If the path is not relative to the home directory, the original path is returned.

func WorkDir added in v0.2.0

func WorkDir() string

WorkDir returns the current working directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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