Fix unused variables

pull/131/head
v2ray 2016-04-26 00:46:04 +02:00
parent 26ebd8dde9
commit a7f40da07a
3 changed files with 6 additions and 2 deletions

View File

@ -129,7 +129,9 @@ func (this *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.Res
} }
data := buffer.Value[:dataLen] data := buffer.Value[:dataLen]
command, err := UnmarshalCommand(cmdId, data) command, err := UnmarshalCommand(cmdId, data)
header.Command = command if err == nil {
header.Command = command
}
} }
return header, nil return header, nil

View File

@ -18,7 +18,7 @@ func TestParseBytes(t *testing.T) {
assert.Error(err).IsNil() assert.Error(err).IsNil()
assert.String(uuid).Equals(str) assert.String(uuid).Equals(str)
uuid, err = ParseBytes([]byte{1, 3, 2, 4}) _, err = ParseBytes([]byte{1, 3, 2, 4})
assert.Error(err).Equals(ErrorInvalidID) assert.Error(err).Equals(ErrorInvalidID)
} }

View File

@ -24,6 +24,7 @@ func TestRegisterInboundConfig(t *testing.T) {
assert.Error(err).IsNil() assert.Error(err).IsNil()
configObj, err = CreateOutboundConfig(protocol, nil) configObj, err = CreateOutboundConfig(protocol, nil)
assert.Error(err).IsNotNil()
assert.Pointer(configObj).IsNil() assert.Pointer(configObj).IsNil()
} }
@ -44,5 +45,6 @@ func TestRegisterOutboundConfig(t *testing.T) {
assert.Error(err).IsNil() assert.Error(err).IsNil()
configObj, err = CreateInboundConfig(protocol, nil) configObj, err = CreateInboundConfig(protocol, nil)
assert.Error(err).IsNotNil()
assert.Pointer(configObj).IsNil() assert.Pointer(configObj).IsNil()
} }