From 1db12416a51579ced46f90f5b0b5928623e527af Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Thu, 12 Mar 2020 19:29:10 -0300 Subject: [PATCH] cmd/swarm,pss,swap: fixed linter errors S1038/S1039 --- cmd/swarm/config.go | 2 +- cmd/swarm/download.go | 2 +- cmd/swarm/main.go | 4 ++-- cmd/swarm/upload_test.go | 2 +- pss/api.go | 2 +- swap/swap.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index b691e58886..92d990c4f2 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -104,7 +104,7 @@ var tomlSettings = toml.Config{ MissingField: func(rt reflect.Type, field string) error { link := "" if unicode.IsUpper(rune(rt.Name()[0])) && rt.PkgPath() != "main" { - link = fmt.Sprintf(", check github.com/ethersphere/swarm/api/config.go for available fields") + link = ", check github.com/ethersphere/swarm/api/config.go for available fields" } return fmt.Errorf("field '%s' is not defined in %s%s", field, rt.String(), link) }, diff --git a/cmd/swarm/download.go b/cmd/swarm/download.go index 97cada64cb..b3c9894539 100644 --- a/cmd/swarm/download.go +++ b/cmd/swarm/download.go @@ -46,7 +46,7 @@ func download(ctx *cli.Context) { case 0: utils.Fatalf("Usage: swarm down [options] []") case 1: - log.Trace(fmt.Sprintf("swarm down: no destination path - assuming working dir")) + log.Trace("swarm down: no destination path - assuming working dir") default: log.Trace(fmt.Sprintf("destination path arg: %s", args[1])) if absDest, err := filepath.Abs(args[1]); err == nil { diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index b1205268e0..b62299e228 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -283,8 +283,8 @@ func keys(ctx *cli.Context) error { bzzkey := crypto.Keccak256Hash(pubkey).Hex() if !ctx.Bool(SwarmCompressedFlag.Name) { - fmt.Println(fmt.Sprintf("bzzkey=%s", bzzkey[2:])) - fmt.Println(fmt.Sprintf("publicKey=%s", pubkeyhex)) + fmt.Print(fmt.Sprintf("bzzkey=%s", bzzkey[2:]), "\n") + fmt.Print(fmt.Sprintf("publicKey=%s", pubkeyhex), "\n") } fmt.Println(fmt.Sprintf("publicKeyCompressed=%s", pubCompressed)) diff --git a/cmd/swarm/upload_test.go b/cmd/swarm/upload_test.go index 2d82302eed..ea2a4d96ac 100644 --- a/cmd/swarm/upload_test.go +++ b/cmd/swarm/upload_test.go @@ -100,7 +100,7 @@ func testDefault(t *testing.T, cluster *testCluster, toEncrypt bool) { tmpFileName} } // upload the file with 'swarm up' and expect a hash - log.Info(fmt.Sprintf("uploading file with 'swarm up'")) + log.Info("uploading file with 'swarm up'") up := runSwarm(t, flags...) _, matches := up.ExpectRegexp(hashRegexp) up.ExpectExit() diff --git a/pss/api.go b/pss/api.go index 97ea641310..5eccf2138a 100644 --- a/pss/api.go +++ b/pss/api.go @@ -84,7 +84,7 @@ func (pssapi *API) Receive(ctx context.Context, topic message.Topic, raw bool, p case err := <-psssub.Err(): log.Warn(fmt.Sprintf("caught subscription error in pss sub topic %x: %v", topic, err)) case <-notifier.Closed(): - log.Warn(fmt.Sprintf("rpc sub notifier closed")) + log.Warn("rpc sub notifier closed") } }() diff --git a/swap/swap.go b/swap/swap.go index 8b4f5d3b73..114dc38cc7 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -614,7 +614,7 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { } // log available balance and ERC20 balance s.logger.Info(InitAction, "Balance information", "chequebook available balance", availableBalance, "ERC20 balance", balance) - promptMessage := fmt.Sprintf("Please provide the amount in HONEY which will deposited to your chequebook (0 for skipping deposit): ") + promptMessage := "Please provide the amount in HONEY which will deposited to your chequebook (0 for skipping deposit): " // need to prompt user for deposit amount prompter := console.Stdin // ask user for input