paths

package
v0.0.0-...-d96f53a Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GoSrcDirs = goSrcDirs()
	GoSrcDir  = GoSrcDirs[0]

	// where to find the Go compiler used to compile gomacro.
	// needed to build compatible plugins
	GoRootDir = build.Default.GOROOT

	// a value whose type is defined in the imports package.
	// used to locate the source directory where to write import files.
	SymbolFromImportsPackage interface{} = imports.Packages
)

Functions

func DirName

func DirName(path string) string

return the string up to (and including) last '/' in path

func FileName

func FileName(path string) string

return the string after last '/' in path

func GetImportsSrcDir

func GetImportsSrcDir() string

lazily compute the directory where to write imports

func RemoveLastByte

func RemoveLastByte(s string) string

remove last byte from string

func Subdir

func Subdir(dirs ...string) string

func UserHomeDir

func UserHomeDir() string

find user's home directory, see https://stackoverflow.com/questions/2552416/how-can-i-find-the-users-home-dir-in-a-cross-platform-manner-using-c without importing "os/user" - which requires cgo to work thus makes cross-compile difficult, see https://github.com/golang/go/issues/11797

Types

This section is empty.

Jump to

Keyboard shortcuts

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