From 225248d2834ff4f41d1367100f90bb228d55cfc5 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 5 Sep 2014 13:56:31 -0500 Subject: [PATCH] Use byte literals in tests to make go vet happy. The go vet command complains about untagged struct initializers when defining a ShaHash directly. This seems to be a limitation where go vet does not exclude the warning for types which are a constant size byte array like it does for normal constant size byte array definition. This commit simply modifies the tests to use a constant definition cast to a ShaHash to overcome the limitation of go vet. --- common_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common_test.go b/common_test.go index a292127a..21706ee5 100644 --- a/common_test.go +++ b/common_test.go @@ -18,21 +18,21 @@ import ( // mainNetGenesisHash is the hash of the first block in the block chain for the // main network (genesis block). -var mainNetGenesisHash = btcwire.ShaHash{ +var mainNetGenesisHash = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy. 0x6f, 0xe2, 0x8c, 0x0a, 0xb6, 0xf1, 0xb3, 0x72, 0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63, 0xf7, 0x4f, 0x93, 0x1e, 0x83, 0x65, 0xe1, 0x5a, 0x08, 0x9c, 0x68, 0xd6, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, -} +}) // mainNetGenesisMerkleRoot is the hash of the first transaction in the genesis // block for the main network. -var mainNetGenesisMerkleRoot = btcwire.ShaHash{ +var mainNetGenesisMerkleRoot = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy. 0x3b, 0xa3, 0xed, 0xfd, 0x7a, 0x7b, 0x12, 0xb2, 0x7a, 0xc7, 0x2c, 0x3e, 0x67, 0x76, 0x8f, 0x61, 0x7f, 0xc8, 0x1b, 0xc3, 0x88, 0x8a, 0x51, 0x32, 0x3a, 0x9f, 0xb8, 0xaa, 0x4b, 0x1e, 0x5e, 0x4a, -} +}) // fakeRandReader implements the io.Reader interface and is used to force // errors in the RandomUint64 function.