whisper: run gofmt to quell linter

This commit is contained in:
Guillaume Ballet 2018-03-31 12:10:53 +02:00
parent 226eccdab0
commit 81f2b79428
3 changed files with 14 additions and 16 deletions

View file

@ -201,12 +201,12 @@ func initialize() {
if *bootstrapMode { if *bootstrapMode {
if !*useLibP2P { if !*useLibP2P {
if len(*argIP) == 0 { if len(*argIP) == 0 {
argIP = scanLineA("Please enter your IP and port (e.g. 127.0.0.1:30348): ") argIP = scanLineA("Please enter your IP and port (e.g. 127.0.0.1:30348): ")
} }
} else if *fileReader { } else if *fileReader {
*bootstrapMode = true *bootstrapMode = true
} else { } else {
if *argPort == 0 { if *argPort == 0 {
for { for {
fmt.Print("Please enter the port to use: ") fmt.Print("Please enter the port to use: ")
@ -759,7 +759,6 @@ func requestExpiredMessagesLoop() {
fmt.Println("Error: topic is invalid, request aborted") fmt.Println("Error: topic is invalid, request aborted")
continue continue
} }
if timeUpp == 0 { if timeUpp == 0 {
timeUpp = 0xFFFFFFFF timeUpp = 0xFFFFFFFF
} }

View file

@ -17,12 +17,12 @@
package whisperv6 package whisperv6
import ( import (
"io"
"github.com/ethereum/go-ethereum/log"
"bytes" "bytes"
"context" "context"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"github.com/ethereum/go-ethereum/log"
"io"
"math" "math"
"github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p"
@ -30,11 +30,11 @@ import (
host "github.com/libp2p/go-libp2p-host" host "github.com/libp2p/go-libp2p-host"
inet "github.com/libp2p/go-libp2p-net" inet "github.com/libp2p/go-libp2p-net"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-peer"
ma "github.com/multiformats/go-multiaddr"
set "gopkg.in/fatih/set.v0"
pstore "github.com/libp2p/go-libp2p-peerstore" pstore "github.com/libp2p/go-libp2p-peerstore"
swarm "github.com/libp2p/go-libp2p-swarm" swarm "github.com/libp2p/go-libp2p-swarm"
"github.com/libp2p/go-libp2p/p2p/host/basic" "github.com/libp2p/go-libp2p/p2p/host/basic"
ma "github.com/multiformats/go-multiaddr"
set "gopkg.in/fatih/set.v0"
) )
// LibP2PStream is a wrapper used to implement the MsgReadWriter // LibP2PStream is a wrapper used to implement the MsgReadWriter
@ -183,7 +183,6 @@ func (server *LibP2PWhisperServer) connectToPeer(p *LibP2PPeer) error {
p.connectionStream = &lps p.connectionStream = &lps
p.ws = p.connectionStream p.ws = p.connectionStream
// TODO send my known list of peers // TODO send my known list of peers
// Call HandlePeer to perform the handshake // Call HandlePeer to perform the handshake
@ -194,7 +193,7 @@ func (server *LibP2PWhisperServer) connectToPeer(p *LibP2PPeer) error {
// Start starts the server // Start starts the server
func (server *LibP2PWhisperServer) Start() error { func (server *LibP2PWhisperServer) Start() error {
server.Host.SetStreamHandler(WhisperProtocolString, func (stream inet.Stream) { server.Host.SetStreamHandler(WhisperProtocolString, func(stream inet.Stream) {
log.Info("opening stream from new peer") log.Info("opening stream from new peer")
pid := stream.Conn().RemotePeer() pid := stream.Conn().RemotePeer()

View file

@ -17,10 +17,10 @@
package whisperv6 package whisperv6
import ( import (
"io"
"bytes" "bytes"
"context" "context"
"encoding/binary" "encoding/binary"
"io"
"io/ioutil" "io/ioutil"
"math" "math"
"math/rand" "math/rand"