Skip to content

Commit

Permalink
Run gofmt -s -w
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Pombeiro committed Dec 20, 2019
1 parent ea0f12b commit f494576
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions eth-node/bridge/nimbus/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ import (
type nimbusNodeWrapper struct {
mu sync.Mutex

routineQueue *RoutineQueue
tid int
routineQueue *RoutineQueue
tid int
nodeStarted bool
cancelPollingChan chan struct{}

w types.Whisper
w types.Whisper
}

type Node interface {
Expand Down Expand Up @@ -122,7 +122,7 @@ func (n *nimbusNodeWrapper) poll() {
panic("poll called from wrong thread")
}

if (n.nodeStarted) {
if n.nodeStarted {
C.nimbus_poll()
}

Expand Down
2 changes: 1 addition & 1 deletion protocol/message_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (s *MessageProcessorSuite) TestHandleDecodedMessagesDatasyncEncrypted() {

dataSyncMessage := datasyncproto.Payload{
Messages: []*datasyncproto.Message{
&datasyncproto.Message{Body: wrappedPayload},
{Body: wrappedPayload},
},
}
marshalledDataSyncMessage, err := proto.Marshal(&dataSyncMessage)
Expand Down
4 changes: 2 additions & 2 deletions protocol/messenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -1468,11 +1468,11 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte
}
}

for id, _ := range modifiedChats {
for id := range modifiedChats {
response.Chats = append(response.Chats, m.allChats[id])
}

for id, _ := range modifiedContacts {
for id := range modifiedContacts {
response.Contacts = append(response.Contacts, m.allContacts[id])
}

Expand Down
38 changes: 19 additions & 19 deletions protocol/messenger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,17 +1097,17 @@ func (s *MessengerSuite) TestChatPersistencePrivateGroupChat() {
ChatType: ChatTypePrivateGroupChat,
Timestamp: 10,
Members: []ChatMember{
ChatMember{
{
ID: "1",
Admin: false,
Joined: true,
},
ChatMember{
{
ID: "2",
Admin: true,
Joined: false,
},
ChatMember{
{
ID: "3",
Admin: true,
Joined: true,
Expand Down Expand Up @@ -1157,12 +1157,12 @@ func (s *MessengerSuite) TestBlockContact() {
LastUpdated: 20,
SystemTags: []string{"1", "2"},
DeviceInfo: []ContactDeviceInfo{
ContactDeviceInfo{
{
InstallationID: "1",
Timestamp: 2,
FCMToken: "token",
},
ContactDeviceInfo{
{
InstallationID: "2",
Timestamp: 3,
FCMToken: "token-2",
Expand Down Expand Up @@ -1216,7 +1216,7 @@ func (s *MessengerSuite) TestBlockContact() {
contact.Name = "blocked"

messages := []*Message{
&Message{
{
ID: "test-1",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
Expand All @@ -1226,7 +1226,7 @@ func (s *MessengerSuite) TestBlockContact() {
},
From: contact.ID,
},
&Message{
{
ID: "test-2",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
Expand All @@ -1236,7 +1236,7 @@ func (s *MessengerSuite) TestBlockContact() {
},
From: contact.ID,
},
&Message{
{
ID: "test-3",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
Expand All @@ -1247,7 +1247,7 @@ func (s *MessengerSuite) TestBlockContact() {
Seen: false,
From: "test",
},
&Message{
{
ID: "test-4",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
Expand All @@ -1258,7 +1258,7 @@ func (s *MessengerSuite) TestBlockContact() {
Seen: false,
From: "test",
},
&Message{
{
ID: "test-5",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
Expand All @@ -1269,7 +1269,7 @@ func (s *MessengerSuite) TestBlockContact() {
Seen: true,
From: "test",
},
&Message{
{
ID: "test-6",
LocalChatID: chat3.ID,
ChatMessage: protobuf.ChatMessage{
Expand All @@ -1280,7 +1280,7 @@ func (s *MessengerSuite) TestBlockContact() {
Seen: false,
From: contact.ID,
},
&Message{
{
ID: "test-7",
LocalChatID: chat3.ID,
ChatMessage: protobuf.ChatMessage{
Expand Down Expand Up @@ -1346,12 +1346,12 @@ func (s *MessengerSuite) TestContactPersistence() {
LastUpdated: 20,
SystemTags: []string{"1", "2"},
DeviceInfo: []ContactDeviceInfo{
ContactDeviceInfo{
{
InstallationID: "1",
Timestamp: 2,
FCMToken: "token",
},
ContactDeviceInfo{
{
InstallationID: "2",
Timestamp: 3,
FCMToken: "token-2",
Expand Down Expand Up @@ -1388,17 +1388,17 @@ func (s *MessengerSuite) TestVerifyENSNames() {
PublicKeyString: pk1,
},
// Not matching pk -> name
enstypes.ENSDetails{
{
Name: "pedro.stateofus.eth",
PublicKeyString: pk2,
},
// Not existing name
enstypes.ENSDetails{
{
Name: "definitelynotpedro.stateofus.eth",
PublicKeyString: pk3,
},
// Malformed pk
enstypes.ENSDetails{
{
Name: "pedro.stateofus.eth",
PublicKeyString: pk4,
},
Expand Down Expand Up @@ -1454,12 +1454,12 @@ func (s *MessengerSuite) TestContactPersistenceUpdate() {
LastUpdated: 20,
SystemTags: []string{"1", "2"},
DeviceInfo: []ContactDeviceInfo{
ContactDeviceInfo{
{
InstallationID: "1",
Timestamp: 2,
FCMToken: "token",
},
ContactDeviceInfo{
{
InstallationID: "2",
Timestamp: 3,
FCMToken: "token-2",
Expand Down
2 changes: 1 addition & 1 deletion protocol/persistence_legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func openTestDB() (*sql.DB, error) {
}

func insertMinimalMessage(p sqlitePersistence, id string) error {
return p.SaveMessagesLegacy([]*Message{&Message{
return p.SaveMessagesLegacy([]*Message{{
ID: id,
LocalChatID: "chat-id",
ChatMessage: protobuf.ChatMessage{Text: "some-text"},
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/status-im/status-go/protocol/messenger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion whisper/rate_limiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func TestPeerLimiterHandlerWithWhitelisting(t *testing.T) {
LimitPerSecIP: 1,
LimitPerSecPeerID: 1,
WhitelistedIPs: []string{"<nil>"}, // no IP is represented as <nil> string
WhitelistedPeerIDs: []enode.ID{enode.ID{0xaa, 0xbb, 0xcc}},
WhitelistedPeerIDs: []enode.ID{{0xaa, 0xbb, 0xcc}},
}, h)
p := &Peer{
peer: p2p.NewPeer(enode.ID{0xaa, 0xbb, 0xcc}, "test-peer", nil),
Expand Down

0 comments on commit f494576

Please sign in to comment.