(l *State, field, env, def string)
| 112 | } |
| 113 | |
| 114 | func setPath(l *State, field, env, def string) { |
| 115 | if path := os.Getenv(env); path == "" || noEnv(l) { |
| 116 | l.PushString(def) |
| 117 | } else { |
| 118 | o := fmt.Sprintf("%c%c", pathListSeparator, pathListSeparator) |
| 119 | n := fmt.Sprintf("%c%s%c", pathListSeparator, def, pathListSeparator) |
| 120 | path = strings.Replace(path, o, n, -1) |
| 121 | l.PushString(path) |
| 122 | } |
| 123 | l.SetField(-2, field) |
| 124 | } |
| 125 | |
| 126 | var packageLibrary = []RegistryFunction{ |
| 127 | {"loadlib", func(l *State) int { |
no test coverage detected