{"modulePath":"github.com/acoderup/goctl","version":"v1.1.7","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package pathx\n\n## Constants\n\n```go\nconst (\n\tNL = \"\\n\"\n)\n```\nNL defines a new line.\n\n## Functions\n\n```go\nfunc Clean(category string) error\n```\nClean deletes all templates and removes the parent directory.\n\n```go\nfunc Copy(src, dest string) error\n```\n\n```go\nfunc CreateIfNotExist(file string) (*os.File, error)\n```\nCreateIfNotExist creates a file if it is not exists.\n\n```go\nfunc CreateTemplate(category, name, content string) error\n```\nCreateTemplate writes template into file even it is exists.\n\n```go\nfunc FileExists(file string) bool\n```\nFileExists returns true if the specified file is exists.\n\n```go\nfunc FileNameWithoutExt(file string) string\n```\nFileNameWithoutExt returns a file name without suffix.\n\n```go\nfunc FindGoModPath(dir string) (string, bool)\n```\nFindGoModPath returns the path in project where has file go.mod, it returns empty string if there is no go.mod file in project.\n\n```go\nfunc FindProjectPath(loc string) (string, bool)\n```\nFindProjectPath returns the parent directory where has file go.mod in project\n\n```go\nfunc GetAutoCompleteHome() (string, error)\n```\nGetAutoCompleteHome returns the auto\\_complete home of goctl.\n\n```go\nfunc GetCacheDir() (string, error)\n```\nGetCacheDir returns the cache dit of goctl.\n\n```go\nfunc GetDefaultGoctlHome() (string, error)\n```\nGetDefaultGoctlHome returns the path value of the goctl home where Join $HOME with .goctl.\n\n```go\nfunc GetGitHome() (string, error)\n```\nGetGitHome returns the git home of goctl.\n\n```go\nfunc GetGoctlHome() (home string, err error)\n```\nGetGoctlHome returns the path value of the goctl, the default path is ~/.goctl, if the path has been set by calling the RegisterGoctlHome method, the user-defined path refers to.\n\n```go\nfunc GetTemplateDir(category string) (string, error)\n```\nGetTemplateDir returns the category path value in GoctlHome where could get it by GetGoctlHome.\n\n```go\nfunc Hash(file string) (string, error)\n```\n\n```go\nfunc InitTemplates(category string, templates map[string]string) error\n```\nInitTemplates creates template files GoctlHome where could get it by GetGoctlHome.\n\n```go\nfunc JoinPackages(pkgs ...string) string\n```\nJoinPackages calls strings.Join and returns\n\n```go\nfunc LoadTemplate(category, file, builtin string) (string, error)\n```\nLoadTemplate gets template content by the specified file.\n\n```go\nfunc MkdirIfNotExist(dir string) error\n```\nMkdirIfNotExist makes directories if the input path is not exists\n\n```go\nfunc MustTempDir() string\n```\nMustTempDir creates a temporary directory.\n\n```go\nfunc PathFromGoSrc() (string, error)\n```\nPathFromGoSrc returns the path without slash where has been trim the prefix $GOPATH\n\n```go\nfunc ReadLink(name string) (string, error)\n```\nReadLink returns the destination of the named symbolic link recursively.\n\n```go\nfunc RegisterGoctlHome(home string)\n```\nRegisterGoctlHome register goctl home path.\n\n```go\nfunc RemoveIfExist(filename string) error\n```\nRemoveIfExist deletes the specified file if it is exists.\n\n```go\nfunc RemoveOrQuit(filename string) error\n```\nRemoveOrQuit deletes the specified file if read a permit command from stdin.\n\n```go\nfunc SameFile(path1, path2 string) (bool, error)\n```\nSameFile compares the between path if the same path, it maybe the same path in case case-ignore, such as: /Users/go\\_zero and /Users/Go\\_zero, as far as we know, this case maybe appear on macOS and Windows.\n\n","path":"github.com/acoderup/goctl/util/pathx","name":"pathx","synopsis":"","isRedistributable":true}
