func listFunctionScriptFiles(root string) ([]string, error) {
	files := []string{}
	err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if info.IsDir() {
			return nil
		}
		if filepath.Ext(path) == ".go" {
			files = append(files, path)
		}
		return nil
	})
	return files, err
}
walk function directory recursively and list files which have ".go" extension.
package command
import (
	"bytes"
	"errors"
	"os"
	"strings"
	"go/parser"
	"go/token"
	"os/exec"
	"path/filepath"
	"github.com/scylladb/go-set/strset"
	"github.com/ysugimoto/go-args"
	"github.com/ysugimoto/ginger/config"
	"github.com/ysugimoto/ginger/logger"
)
func findDependencyPackages(root string, localPackages []string) ([]*strset.Set, error) {
	files, err := listFunctionScriptFiles(root)
	if err != nil {
		return nil, err
	}
	packages := []*strset.Set{
		strset.New("github.com/aws/aws-lambda-go/lambda"),
		strset.New(),
		strset.New(),
	}
	for _, f := range files {
		t := token.NewFileSet()
		ast, err := parser.ParseFile(t, f, nil, parser.ImportsOnly)
		if err != nil {
			continue
		}
		for _, i := range ast.Imports {
			pkg := strings.Trim(i.Path.Value, `"`)
			if !strings.Contains(pkg, ".") {
				continue
			}
			var ignored bool
			for _, v := range localPackages {
				if strings.HasPrefix(pkg, v) {
					ignored = true
					break
				}
			}
			if ignored {
				continue
			}
			// Get import path depth
			level := len(strings.Split(pkg, "/")) - 1
			// Expand slice if depth is not enough
			for len(packages)-1 < level {
				packages = append(packages, strset.New())
			}
			packages[level].Add(pkg)
		}
	}
	return packages, nil
}
// walk function directory recursively and list files which have ".go" extension.