make import statement clean

Signed-off-by: xuchunming1 <xuchunming@jd.com>
This commit is contained in:
xuchunming1 2021-07-01 15:18:12 +08:00
commit 9020c53820

View file

@ -2,15 +2,17 @@ package session
import ( import (
"fmt" "fmt"
"github.com/bettercap/bettercap/caplets"
_ "github.com/bettercap/bettercap/js"
"github.com/evilsocket/islazy/fs"
"github.com/evilsocket/islazy/plugin"
"github.com/evilsocket/islazy/str"
"io/ioutil" "io/ioutil"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strings" "strings"
"github.com/bettercap/bettercap/caplets"
_ "github.com/bettercap/bettercap/js"
"github.com/evilsocket/islazy/fs"
"github.com/evilsocket/islazy/plugin"
"github.com/evilsocket/islazy/str"
) )
// require("telegram.js") // require("telegram.js")
@ -37,7 +39,7 @@ func preprocess(basePath string, code string, level int) (string, error) {
filepath.Join(caplets.InstallBase, fileName), filepath.Join(caplets.InstallBase, fileName),
} }
if strings.Contains(fileName, ".js") == false { if !strings.Contains(fileName, ".js") {
searchPaths = append(searchPaths, []string{ searchPaths = append(searchPaths, []string{
filepath.Join(basePath, fileName) + ".js", filepath.Join(basePath, fileName) + ".js",
filepath.Join(caplets.InstallBase, fileName) + ".js", filepath.Join(caplets.InstallBase, fileName) + ".js",