Skip to content

Commit 67e6bab

Browse files
committed
chore: update code
1 parent 4f0b8d3 commit 67e6bab

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

internal/luai/plugin.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ import (
1515
lua "github.com/yuin/gopher-lua"
1616
)
1717

18-
const (
19-
luaPluginObjKey = "PLUGIN"
20-
)
21-
2218
type LuaPlugin struct {
2319
vm *LuaVM
2420
pluginObj *lua.LTable
@@ -230,7 +226,7 @@ func CreateLuaPlugin(pluginDirPath string, config *config.Config, runtimeVersion
230226
}
231227

232228
vm.Instance.SetGlobal(base.Runtime, r)
233-
pluginObj := vm.Instance.GetGlobal(luaPluginObjKey)
229+
pluginObj := vm.Instance.GetGlobal(base.LuaPluginObjKey)
234230
if pluginObj.Type() == lua.LTNil {
235231
return nil, fmt.Errorf("plugin object not found")
236232
}

internal/plugin.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ import (
3333
"regexp"
3434
)
3535

36-
const (
37-
luaPluginObjKey = "PLUGIN"
38-
osType = "OS_TYPE"
39-
archType = "ARCH_TYPE"
40-
runtime = "RUNTIME"
41-
)
42-
4336
var ErrPluginNotFound = errors.New("plugin not found")
4437

4538
func CreatePluginFromPath(tempInstallPath string, manager *Manager) (*PluginWrapper, error) {

0 commit comments

Comments
 (0)