diff --git a/interfaces/utility/trackResults.go b/interfaces/utility/trackResults.go index 70b5e43f4d762aba8b99957b6b7e1efb4d852695..cd766624d475141edbad94731f3a3da092e4bcfd 100644 --- a/interfaces/utility/trackResults.go +++ b/interfaces/utility/trackResults.go @@ -26,5 +26,5 @@ func TrackResults(resultsCh chan ds.EventReturn, numResults int) (bool, int, int } } - return (numTimeOut + numRoundFail) > 0, numRoundFail, numTimeOut + return (numTimeOut + numRoundFail) == 0, numRoundFail, numTimeOut } diff --git a/keyExchange/utils_test.go b/keyExchange/utils_test.go index c11728b1afd66ace0983fce8dcf2134978f35150..bda05f0b822888261f8f61f460840536dd9ddbc5 100644 --- a/keyExchange/utils_test.go +++ b/keyExchange/utils_test.go @@ -101,11 +101,7 @@ func (t *testNetworkManagerGeneric) GetStoppable() stoppable.Stoppable { func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.NetworkManager) { switch i.(type) { - case *testing.T: - break - case *testing.M: - break - case *testing.B: + case *testing.T, *testing.M, *testing.B, *testing.PB: break default: globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) @@ -208,11 +204,7 @@ func (t *testNetworkManagerFullExchange) GetStoppable() stoppable.Stoppable { func InitTestingContextFullExchange(i interface{}) (*storage.Session, *switchboard.Switchboard, interfaces.NetworkManager) { switch i.(type) { - case *testing.T: - break - case *testing.M: - break - case *testing.B: + case *testing.T, *testing.M, *testing.B, *testing.PB: break default: globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) diff --git a/storage/e2e/session.go b/storage/e2e/session.go index 43eacbf80f676c1eeefbab5adcb395b31cbcd08a..78997dc00d7e78ca1b5badb5d82ef6e676837f7a 100644 --- a/storage/e2e/session.go +++ b/storage/e2e/session.go @@ -243,11 +243,7 @@ func getSessionIDFromBaseKey(baseKey *cyclic.Int) SessionID { // FOR TESTING PURPOSES ONLY func GetSessionIDFromBaseKeyForTesting(baseKey *cyclic.Int, i interface{}) SessionID { switch i.(type) { - case *testing.T: - break - case *testing.M: - break - case *testing.B: + case *testing.T, *testing.M, *testing.B, *testing.PB: break default: globals.Log.FATAL.Panicf("GetSessionIDFromBaseKeyForTesting is restricted to testing only. Got %T", i) diff --git a/storage/session.go b/storage/session.go index 8f276039df5eae534421f57008921d2e90852749..ab8d23d99ef05f114fa3f17b5b0333bf2906d682 100644 --- a/storage/session.go +++ b/storage/session.go @@ -290,11 +290,7 @@ func (s *Session) Delete(key string) error { // FOR TESTING ONLY func InitTestingSession(i interface{}) *Session { switch i.(type) { - case *testing.T: - break - case *testing.M: - break - case *testing.B: + case *testing.T, *testing.M, *testing.B, *testing.PB: break default: globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) diff --git a/ud/confirmFact.go b/ud/confirmFact.go index b715a620d19af1c3f3cdb9f4c25599334f70c277..a625e7e6337d8facc4cff7096d078ee53b264a7d 100644 --- a/ud/confirmFact.go +++ b/ud/confirmFact.go @@ -2,10 +2,10 @@ package ud import ( "github.com/pkg/errors" + jww "github.com/spf13/jwalterweatherman" pb "gitlab.com/elixxir/comms/mixmessages" "gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/comms/messages" - jww "github.com/spf13/jwalterweatherman" ) type confirmFactComm interface { @@ -16,14 +16,14 @@ type confirmFactComm interface { // AddFact while the code will come over the associated communications system func (m *Manager) SendConfirmFact(confirmationID, code string) error { jww.INFO.Printf("ud.SendConfirmFact(%s, %s)", confirmationID, code) - if err := m.confirmFact(confirmationID, code, m.comms); err!=nil{ + if err := m.confirmFact(confirmationID, code, m.comms); err != nil { return errors.WithMessage(err, "Failed to confirm fact") } return nil } func (m *Manager) confirmFact(confirmationID, code string, comm confirmFactComm) error { - if !m.IsRegistered(){ + if !m.IsRegistered() { return errors.New("Failed to confirm fact: " + "client is not registered") } diff --git a/ud/remove.go b/ud/remove.go index d679a1abd479230ae2baa9e6dc59a6d49c07fcd5..966609c6e2f8c26ad0f3478356e03b1f462bf02f 100644 --- a/ud/remove.go +++ b/ud/remove.go @@ -2,11 +2,11 @@ package ud import ( "github.com/pkg/errors" + jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/comms/mixmessages" "gitlab.com/elixxir/primitives/fact" "gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/comms/messages" - jww "github.com/spf13/jwalterweatherman" ) type removeFactComms interface { @@ -21,7 +21,7 @@ func (m *Manager) RemoveFact(fact fact.Fact) error { } func (m *Manager) removeFact(fact fact.Fact, rFC removeFactComms) error { - if !m.IsRegistered(){ + if !m.IsRegistered() { return errors.New("Failed to remove fact: " + "client is not registered") }