pathutil

package
Version: v0.0.0-...-3518944 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2017 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Relative

func Relative(name string) string

Relative returns the given path relative to the application binary e.g. binary is at /home/fiam/example/example Relative("foo") returns /home/fiam/example/foo Relative("foo/bar") returns /home/fiam/example/foo/bar Relative("/foo/bar") returns /home/fiam/example/foo/bar. Note that when running tests (from e.g. go test) or go run (e.g. go run myfile.go), this function will return the path relative to the current directory rather than the binary. This is done in order to allow functions which use relative paths to work under those circumstances, since go puts the binaries in a temporary directory when using go test or go run, but runs them from the current directory.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL