Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Isan-Rivkin committed Sep 13, 2023
1 parent a44293e commit a6bec34
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/actions/lua.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/Shopify/go-lua"
lualibs "github.com/treeverse/lakefs/pkg/actions/lua"
"github.com/treeverse/lakefs/pkg/actions/lua/lakefs"
catalogexport "github.com/treeverse/lakefs/pkg/actions/lua/lakefs/catalog_export"
catalogexport "github.com/treeverse/lakefs/pkg/actions/lua/lakefs/catalogexport"
luautil "github.com/treeverse/lakefs/pkg/actions/lua/util"
"github.com/treeverse/lakefs/pkg/auth"
"github.com/treeverse/lakefs/pkg/auth/model"
Expand Down Expand Up @@ -67,7 +67,7 @@ func injectHookContext(l *lua.State, ctx context.Context, user *model.User, endp
luautil.DeepPush(l, args)
l.SetGlobal("args")
lakefs.OpenClient(l, ctx, user, endpoint)
catalogexport.OpenLuaPackage(l, ctx)
catalogexport.OpenLuaPackage(l)
}

type loggingBuffer struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package catalog_export
package catalogexport

import (
"context"
"embed"
"io/fs"

Expand All @@ -12,15 +11,15 @@ import (
var modulePath embed.FS

// OpenLuaPackage load lua code as a package in the runtime
func OpenLuaPackage(l *lua.State, ctx context.Context) {
func OpenLuaPackage(l *lua.State) {
// order here matters each when packages rely on each other
loadLuaAsPackage(l, ctx, "lakefs/catalog_export/common", "common.lua")
loadLuaAsPackage(l, ctx, "lakefs/catalog_export/table_extractor", "table_extractor.lua")
loadLuaAsPackage(l, "lakefs/catalog_export/common", "common.lua")
loadLuaAsPackage(l, "lakefs/catalog_export/table_extractor", "table_extractor.lua")
// lib.lua is high level facade for users
loadLuaAsPackage(l, ctx, "lakefs/catalog_export", "lib.lua")
loadLuaAsPackage(l, "lakefs/catalog_export", "lib.lua")
}

func loadLuaAsPackage(l *lua.State, ctx context.Context, importAlias, scriptName string) {
func loadLuaAsPackage(l *lua.State, importAlias, scriptName string) {
lua.Require(l, importAlias, func(l *lua.State) int {
data, err := fs.ReadFile(modulePath, scriptName)
if err != nil {
Expand Down

0 comments on commit a6bec34

Please sign in to comment.