Run `gofmt -s -w`

This commit is contained in:
Pedro Pombeiro 2019-12-19 16:40:44 +01:00 committed by Pedro Pombeiro
parent ea0f12b920
commit f494576ca2
7 changed files with 30 additions and 30 deletions

View File

@ -122,7 +122,7 @@ func (n *nimbusNodeWrapper) poll() {
panic("poll called from wrong thread")
}
if (n.nodeStarted) {
if n.nodeStarted {
C.nimbus_poll()
}

View File

@ -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)

View File

@ -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])
}

View File

@ -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,
@ -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",
@ -1216,7 +1216,7 @@ func (s *MessengerSuite) TestBlockContact() {
contact.Name = "blocked"
messages := []*Message{
&Message{
{
ID: "test-1",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
@ -1226,7 +1226,7 @@ func (s *MessengerSuite) TestBlockContact() {
},
From: contact.ID,
},
&Message{
{
ID: "test-2",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
@ -1236,7 +1236,7 @@ func (s *MessengerSuite) TestBlockContact() {
},
From: contact.ID,
},
&Message{
{
ID: "test-3",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
@ -1247,7 +1247,7 @@ func (s *MessengerSuite) TestBlockContact() {
Seen: false,
From: "test",
},
&Message{
{
ID: "test-4",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
@ -1258,7 +1258,7 @@ func (s *MessengerSuite) TestBlockContact() {
Seen: false,
From: "test",
},
&Message{
{
ID: "test-5",
LocalChatID: chat2.ID,
ChatMessage: protobuf.ChatMessage{
@ -1269,7 +1269,7 @@ func (s *MessengerSuite) TestBlockContact() {
Seen: true,
From: "test",
},
&Message{
{
ID: "test-6",
LocalChatID: chat3.ID,
ChatMessage: protobuf.ChatMessage{
@ -1280,7 +1280,7 @@ func (s *MessengerSuite) TestBlockContact() {
Seen: false,
From: contact.ID,
},
&Message{
{
ID: "test-7",
LocalChatID: chat3.ID,
ChatMessage: protobuf.ChatMessage{
@ -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",
@ -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,
},
@ -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",

View File

@ -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"},

View File

@ -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])
}

View File

@ -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),