paths

package
v0.0.0-...-f54e8e0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MPL-2.0 Imports: 8 Imported by: 1

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 (but excluding) last '/' in path If path contains no '/', return empty string

func FileName

func FileName(path string) string

return the string after last '/' in path If path contains no '/', return path itself

func GetImportsSrcDir

func GetImportsSrcDir() string

lazily compute the directory where to write imports

func RemoveFinalSlash

func RemoveFinalSlash(s string) string

remove final '/' from string, if present

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