MCPcopy Index your code
hub / github.com/yuin/gopher-lua / loGetPath

Function loGetPath

loadlib.go:14–28  ·  view source on GitHub ↗
(env string, defpath string)

Source from the content-addressed store, hash-verified

12var loLoaders = []LGFunction{loLoaderPreload, loLoaderLua}
13
14func loGetPath(env string, defpath string) string {
15 path := os.Getenv(env)
16 if len(path) == 0 {
17 path = defpath
18 }
19 path = strings.Replace(path, ";;", ";"+defpath+";", -1)
20 if os.PathSeparator != '/' {
21 dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
22 if err != nil {
23 panic(err)
24 }
25 path = strings.Replace(path, "!", dir, -1)
26 }
27 return path
28}
29
30func loFindFile(L *LState, name, pname string) (string, string) {
31 name = strings.Replace(name, ".", string(os.PathSeparator), -1)

Callers 1

OpenPackageFunction · 0.85

Calls 1

ReplaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…