Commit af28d128 authored by kiel barry's avatar kiel barry Committed by Felix Lange

console: squash golint warnings (#16836)

parent 0ad32d3b
...@@ -271,7 +271,7 @@ func (b *bridge) SleepBlocks(call otto.FunctionCall) (response otto.Value) { ...@@ -271,7 +271,7 @@ func (b *bridge) SleepBlocks(call otto.FunctionCall) (response otto.Value) {
} }
type jsonrpcCall struct { type jsonrpcCall struct {
Id int64 ID int64
Method string Method string
Params []interface{} Params []interface{}
} }
...@@ -304,7 +304,7 @@ func (b *bridge) Send(call otto.FunctionCall) (response otto.Value) { ...@@ -304,7 +304,7 @@ func (b *bridge) Send(call otto.FunctionCall) (response otto.Value) {
resps, _ := call.Otto.Object("new Array()") resps, _ := call.Otto.Object("new Array()")
for _, req := range reqs { for _, req := range reqs {
resp, _ := call.Otto.Object(`({"jsonrpc":"2.0"})`) resp, _ := call.Otto.Object(`({"jsonrpc":"2.0"})`)
resp.Set("id", req.Id) resp.Set("id", req.ID)
var result json.RawMessage var result json.RawMessage
err = b.client.Call(&result, req.Method, req.Params...) err = b.client.Call(&result, req.Method, req.Params...)
switch err := err.(type) { switch err := err.(type) {
......
...@@ -73,6 +73,8 @@ type Console struct { ...@@ -73,6 +73,8 @@ type Console struct {
printer io.Writer // Output writer to serialize any display strings to printer io.Writer // Output writer to serialize any display strings to
} }
// New initializes a JavaScript interpreted runtime environment and sets defaults
// with the config struct.
func New(config Config) (*Console, error) { func New(config Config) (*Console, error) {
// Handle unset config values gracefully // Handle unset config values gracefully
if config.Prompter == nil { if config.Prompter == nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment