Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Commit ca3dddc

Browse files
kielbarrygbalint
authored andcommitted
cmd: various golint fixes (#16700)
* cmd: various golint fixes * cmd: update to pr change request * cmd: update to pr change request
1 parent f036627 commit ca3dddc

File tree

5 files changed

+28
-24
lines changed

5 files changed

+28
-24
lines changed

cmd/clef/main.go

+19-19
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ import (
4747
"gopkg.in/urfave/cli.v1"
4848
)
4949

50-
// ExternalApiVersion -- see extapi_changelog.md
51-
const ExternalApiVersion = "2.0.0"
50+
// ExternalAPIVersion -- see extapi_changelog.md
51+
const ExternalAPIVersion = "2.0.0"
5252

53-
// InternalApiVersion -- see intapi_changelog.md
54-
const InternalApiVersion = "2.0.0"
53+
// InternalAPIVersion -- see intapi_changelog.md
54+
const InternalAPIVersion = "2.0.0"
5555

5656
const legalWarning = `
5757
WARNING!
@@ -398,10 +398,10 @@ func signer(c *cli.Context) error {
398398
}
399399
// register signer API with server
400400
var (
401-
extapiUrl = "n/a"
402-
ipcApiUrl = "n/a"
401+
extapiURL = "n/a"
402+
ipcapiURL = "n/a"
403403
)
404-
rpcApi := []rpc.API{
404+
rpcAPI := []rpc.API{
405405
{
406406
Namespace: "account",
407407
Public: true,
@@ -415,12 +415,12 @@ func signer(c *cli.Context) error {
415415

416416
// start http server
417417
httpEndpoint := fmt.Sprintf("%s:%d", c.String(utils.RPCListenAddrFlag.Name), c.Int(rpcPortFlag.Name))
418-
listener, _, err := rpc.StartHTTPEndpoint(httpEndpoint, rpcApi, []string{"account"}, cors, vhosts)
418+
listener, _, err := rpc.StartHTTPEndpoint(httpEndpoint, rpcAPI, []string{"account"}, cors, vhosts)
419419
if err != nil {
420420
utils.Fatalf("Could not start RPC api: %v", err)
421421
}
422-
extapiUrl = fmt.Sprintf("http://%s", httpEndpoint)
423-
log.Info("HTTP endpoint opened", "url", extapiUrl)
422+
extapiURL = fmt.Sprintf("http://%s", httpEndpoint)
423+
log.Info("HTTP endpoint opened", "url", extapiURL)
424424

425425
defer func() {
426426
listener.Close()
@@ -430,19 +430,19 @@ func signer(c *cli.Context) error {
430430
}
431431
if !c.Bool(utils.IPCDisabledFlag.Name) {
432432
if c.IsSet(utils.IPCPathFlag.Name) {
433-
ipcApiUrl = c.String(utils.IPCPathFlag.Name)
433+
ipcapiURL = c.String(utils.IPCPathFlag.Name)
434434
} else {
435-
ipcApiUrl = filepath.Join(configDir, "clef.ipc")
435+
ipcapiURL = filepath.Join(configDir, "clef.ipc")
436436
}
437437

438-
listener, _, err := rpc.StartIPCEndpoint(ipcApiUrl, rpcApi)
438+
listener, _, err := rpc.StartIPCEndpoint(ipcapiURL, rpcAPI)
439439
if err != nil {
440440
utils.Fatalf("Could not start IPC api: %v", err)
441441
}
442-
log.Info("IPC endpoint opened", "url", ipcApiUrl)
442+
log.Info("IPC endpoint opened", "url", ipcapiURL)
443443
defer func() {
444444
listener.Close()
445-
log.Info("IPC endpoint closed", "url", ipcApiUrl)
445+
log.Info("IPC endpoint closed", "url", ipcapiURL)
446446
}()
447447

448448
}
@@ -453,10 +453,10 @@ func signer(c *cli.Context) error {
453453
}
454454
ui.OnSignerStartup(core.StartupInfo{
455455
Info: map[string]interface{}{
456-
"extapi_version": ExternalApiVersion,
457-
"intapi_version": InternalApiVersion,
458-
"extapi_http": extapiUrl,
459-
"extapi_ipc": ipcApiUrl,
456+
"extapi_version": ExternalAPIVersion,
457+
"intapi_version": InternalAPIVersion,
458+
"extapi_http": extapiURL,
459+
"extapi_ipc": ipcapiURL,
460460
},
461461
})
462462

cmd/evm/json_logger.go

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ type JSONLogger struct {
3232
cfg *vm.LogConfig
3333
}
3434

35+
// NewJSONLogger creates a new EVM tracer that prints execution steps as JSON objects
36+
// into the provided stream.
3537
func NewJSONLogger(cfg *vm.LogConfig, writer io.Writer) *JSONLogger {
3638
return &JSONLogger{json.NewEncoder(writer), cfg}
3739
}

cmd/evm/staterunner.go

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ var stateTestCommand = cli.Command{
3838
ArgsUsage: "<file>",
3939
}
4040

41+
// StatetestResult contains the execution status after running a state test, any
42+
// error that might have occurred and a dump of the final state if requested.
4143
type StatetestResult struct {
4244
Name string `json:"name"`
4345
Pass bool `json:"pass"`

cmd/geth/accountcmd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func importWallet(ctx *cli.Context) error {
340340
if len(keyfile) == 0 {
341341
utils.Fatalf("keyfile must be given as argument")
342342
}
343-
keyJson, err := ioutil.ReadFile(keyfile)
343+
keyJSON, err := ioutil.ReadFile(keyfile)
344344
if err != nil {
345345
utils.Fatalf("Could not read wallet file: %v", err)
346346
}
@@ -349,7 +349,7 @@ func importWallet(ctx *cli.Context) error {
349349
passphrase := getPassPhrase("", false, 0, utils.MakePasswordList(ctx))
350350

351351
ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore)
352-
acct, err := ks.ImportPreSaleKey(keyJson, passphrase)
352+
acct, err := ks.ImportPreSaleKey(keyJSON, passphrase)
353353
if err != nil {
354354
utils.Fatalf("%v", err)
355355
}

cmd/geth/bugcmd.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var bugCommand = cli.Command{
4141
Category: "MISCELLANEOUS COMMANDS",
4242
}
4343

44-
const issueUrl = "https://github.com/ethereum/go-ethereum/issues/new"
44+
const issueURL = "https://github.com/ethereum/go-ethereum/issues/new"
4545

4646
// reportBug reports a bug by opening a new URL to the go-ethereum GH issue
4747
// tracker and setting default values as the issue body.
@@ -58,8 +58,8 @@ func reportBug(ctx *cli.Context) error {
5858
fmt.Fprintln(&buff, header)
5959

6060
// open a new GH issue
61-
if !browser.Open(issueUrl + "?body=" + url.QueryEscape(buff.String())) {
62-
fmt.Printf("Please file a new issue at %s using this template:\n\n%s", issueUrl, buff.String())
61+
if !browser.Open(issueURL + "?body=" + url.QueryEscape(buff.String())) {
62+
fmt.Printf("Please file a new issue at %s using this template:\n\n%s", issueURL, buff.String())
6363
}
6464
return nil
6565
}

0 commit comments

Comments
 (0)