From eb051c39e253dba7fc34a2f02d6aca5a7fa16569 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 14 Jan 2025 10:56:07 +0800 Subject: [PATCH] console: squash golint warnings (#16836) --- console/bridge.go | 4 ++-- console/console.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/console/bridge.go b/console/bridge.go index 34f77dcbfbe48..3f7982b5f6981 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -314,7 +314,7 @@ func (b *bridge) SleepBlocks(call jsre.Call) (goja.Value, error) { } type jsonrpcCall struct { - Id int64 + ID int64 Method string Params []interface{} } @@ -348,7 +348,7 @@ func (b *bridge) Send(call jsre.Call) (goja.Value, error) { for _, req := range reqs { resp := call.VM.NewObject() resp.Set("jsonrpc", "2.0") - resp.Set("id", req.Id) + resp.Set("id", req.ID) var result json.RawMessage err = b.client.Call(&result, req.Method, req.Params...) diff --git a/console/console.go b/console/console.go index 21d66f5b6af6d..af28c2e4d534e 100644 --- a/console/console.go +++ b/console/console.go @@ -73,6 +73,8 @@ type Console struct { 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) { // Handle unset config values gracefully if config.Prompter == nil {