tilde

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 4 Imported by: 0

README

command

Your project's description

License

See LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(p string) (string, error)

Expand a tilde path with the user's homedir.

Works for ~ and for ~user.

In the event that a homedir can't be looked up, the original string is returned with an error. The error may be discarded if the original string is what you want in the event of failure anyway.

Does not support ~ at any other position other than the first char.

func MayExpand

func MayExpand(p string) string

Try to expand. Return original string on failure.

This is similar to sh behavior.

func MustExpand

func MustExpand(p string) string

Try to expand. Panic on error.

This is similar to zsh.

Types

This section is empty.

Jump to

Keyboard shortcuts

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