diff --git a/common/cauthdsl/cauthdsl_test.go b/common/cauthdsl/cauthdsl_test.go index 88dcfa50a2e..7b3e56c7fc6 100644 --- a/common/cauthdsl/cauthdsl_test.go +++ b/common/cauthdsl/cauthdsl_test.go @@ -93,10 +93,7 @@ func (md *mockDeserializer) DeserializeIdentity(serializedIdentity []byte) (msp. return &mockIdentity{idBytes: serializedIdentity}, nil } -var validSignature = []byte("signed") var signers = [][]byte{[]byte("signer0"), []byte("signer1")} -var msgs = [][]byte{nil, nil} -var moreMsgs = [][]byte{nil, nil, nil} func TestSimpleSignature(t *testing.T) { policy := policydsl.Envelope(policydsl.SignedBy(0), signers) diff --git a/common/flogging/core_test.go b/common/flogging/core_test.go index 379a46c1f00..3ec4e61f759 100644 --- a/common/flogging/core_test.go +++ b/common/flogging/core_test.go @@ -199,7 +199,8 @@ func TestObserverCheck(t *testing.T) { checkedEntry := &zapcore.CheckedEntry{} levels := &flogging.LoggerLevels{} - levels.ActivateSpec("debug") + err := levels.ActivateSpec("debug") + assert.NoError(t, err) core := &flogging.Core{ LevelEnabler: zap.LevelEnablerFunc(func(l zapcore.Level) bool { return true }), Levels: levels, @@ -227,7 +228,8 @@ func TestObserverWriteEntry(t *testing.T) { } levels := &flogging.LoggerLevels{} - levels.ActivateSpec("debug") + err := levels.ActivateSpec("debug") + assert.NoError(t, err) selector := &sw{} output := &sw{} core := &flogging.Core{ @@ -241,7 +243,7 @@ func TestObserverWriteEntry(t *testing.T) { Observer: observer, } - err := core.Write(entry, fields) + err = core.Write(entry, fields) assert.NoError(t, err) assert.Equal(t, 1, observer.WriteEntryCallCount()) diff --git a/common/flogging/global_test.go b/common/flogging/global_test.go index 05ed372c5fc..8d4e9fa04e0 100644 --- a/common/flogging/global_test.go +++ b/common/flogging/global_test.go @@ -17,8 +17,9 @@ import ( func TestGlobalReset(t *testing.T) { flogging.Reset() - flogging.Global.SetFormat("json") - err := flogging.Global.ActivateSpec("logger=debug") + err := flogging.Global.SetFormat("json") + assert.NoError(t, err) + err = flogging.Global.ActivateSpec("logger=debug") assert.NoError(t, err) system, err := flogging.New(flogging.Config{}) diff --git a/common/flogging/logging_test.go b/common/flogging/logging_test.go index cfdfdc7f528..be44a26d759 100644 --- a/common/flogging/logging_test.go +++ b/common/flogging/logging_test.go @@ -66,7 +66,8 @@ func TestLoggingSetWriter(t *testing.T) { original := logging.SetWriter(ws) assert.Exactly(t, old, original) - logging.Write([]byte("hello")) + _, err = logging.Write([]byte("hello")) + assert.NoError(t, err) assert.Equal(t, 1, ws.WriteCallCount()) assert.Equal(t, []byte("hello"), ws.WriteArgsForCall(0))