From 339995c101f7056107441f39456bfb9340bdc03e Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 12 Jan 2018 13:04:20 -0500 Subject: [PATCH] Fixing gofmt --- application/application_factory.go | 1 - channels/chatchannel_test.go | 2 +- connection/channelmanager_test.go | 3 +-- utils/crypto.go | 10 +++++----- utils/crypto_test.go | 10 +++++----- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/application/application_factory.go b/application/application_factory.go index c29aa77..d3687e9 100644 --- a/application/application_factory.go +++ b/application/application_factory.go @@ -38,4 +38,3 @@ func (af *ApplicationInstanceFactory) GetApplicationInstance(rc *connection.Conn } return rai } - diff --git a/channels/chatchannel_test.go b/channels/chatchannel_test.go index c34c5a2..e150c44 100644 --- a/channels/chatchannel_test.go +++ b/channels/chatchannel_test.go @@ -121,6 +121,6 @@ func TestChatChannelOperations(t *testing.T) { chatChannel.SendMessage("hello") ackMessage := messageBuilder.AckChatMessage(0, true) - chatChannel.Packet(ackMessage) + chatChannel.Packet(ackMessage) } diff --git a/connection/channelmanager_test.go b/connection/channelmanager_test.go index 0fb2339..01da297 100644 --- a/connection/channelmanager_test.go +++ b/connection/channelmanager_test.go @@ -6,7 +6,7 @@ import ( ) type OverrideChatChannel struct { - channels.ChatChannel + channels.ChatChannel } // Singleton - for chat channels there can only be one instance per direction @@ -14,7 +14,6 @@ func (cc *OverrideChatChannel) Singleton() bool { return false } - func TestClientManagerDuplicateMultiple(t *testing.T) { ccm := NewClientChannelManager() chatChannel := new(OverrideChatChannel) diff --git a/utils/crypto.go b/utils/crypto.go index f8366f0..8186d7b 100644 --- a/utils/crypto.go +++ b/utils/crypto.go @@ -20,11 +20,11 @@ const ( ) func GetRandNumber() *big.Int { - num, err := rand.Int(rand.Reader, big.NewInt(math.MaxUint32)) - // If we can't generate random numbers then panicking is probably - // the best option. - CheckError(err) - return num + num, err := rand.Int(rand.Reader, big.NewInt(math.MaxUint32)) + // If we can't generate random numbers then panicking is probably + // the best option. + CheckError(err) + return num } // GeneratePrivateKey generates a new private key for use diff --git a/utils/crypto_test.go b/utils/crypto_test.go index 88ef735..504d01b 100644 --- a/utils/crypto_test.go +++ b/utils/crypto_test.go @@ -1,8 +1,8 @@ package utils import ( - "testing" "math" + "testing" ) func TestGeneratePrivateKey(t *testing.T) { @@ -20,8 +20,8 @@ func TestLoadPrivateKey(t *testing.T) { } func TestGetRandNumber(t *testing.T) { - num := GetRandNumber() - if !num.IsUint64() || num.Uint64() > uint64(math.MaxUint32) { - t.Errorf("Error random number outside of expected bounds %v", num) - } + num := GetRandNumber() + if !num.IsUint64() || num.Uint64() > uint64(math.MaxUint32) { + t.Errorf("Error random number outside of expected bounds %v", num) + } }