mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
nothing but import format change
Signed-off-by: xuchunming1 <xuchunming@jd.com>
This commit is contained in:
parent
9020c53820
commit
e9dad78ec2
6 changed files with 14 additions and 7 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/base64"
|
||||
|
||||
"github.com/robertkrimen/otto"
|
||||
)
|
||||
|
||||
|
@ -13,6 +14,7 @@ func btoa(call otto.FunctionCall) otto.Value {
|
|||
if err != nil {
|
||||
return ReportError("Could not convert to string: %s", varValue)
|
||||
}
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
|
@ -21,10 +23,12 @@ func atob(call otto.FunctionCall) otto.Value {
|
|||
if err != nil {
|
||||
return ReportError("Could not decode string: %s", call.Argument(0).String())
|
||||
}
|
||||
|
||||
v, err := otto.ToValue(string(varValue))
|
||||
if err != nil {
|
||||
return ReportError("Could not convert to string: %s", varValue)
|
||||
}
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue