Przeglądaj źródła

golint fixes #2

Tom Harwood 11 lat temu
rodzic
commit
0101a5ded8

+ 1 - 1
bitset/bitset.go

@@ -250,7 +250,7 @@ func (b *Bitset) ByteAt(index int) byte {
 		log.Panicf("Index %d out of range", index)
 		log.Panicf("Index %d out of range", index)
 	}
 	}
 
 
-	var result byte = 0
+	var result byte
 
 
 	for i := index; i < index+8 && i < b.numBits; i++ {
 	for i := index; i < index+8 && i < b.numBits; i++ {
 		result <<= 1
 		result <<= 1

+ 1 - 1
reedsolomon/gf_poly_test.go

@@ -75,7 +75,7 @@ func TestGFPolyequals(t *testing.T) {
 	}
 	}
 
 
 	for _, test := range tests {
 	for _, test := range tests {
-		var isEqual bool = test.a.equals(test.b)
+		isEqual := test.a.equals(test.b)
 
 
 		if isEqual != test.isEqual {
 		if isEqual != test.isEqual {
 			t.Errorf("%s and %s equality is %t (got %t)\n", test.a.string(false), test.b.string(false),
 			t.Errorf("%s and %s equality is %t (got %t)\n", test.a.string(false), test.b.string(false),

+ 1 - 1
reedsolomon/reed_solomon.go

@@ -1,7 +1,7 @@
 // go-qrcode
 // go-qrcode
 // Copyright 2014 Tom Harwood
 // Copyright 2014 Tom Harwood
 
 
-// Reed-Solomon error correction for QR Code 2005.
+// Package reedsolomon provides error correction encoding for QR Code 2005.
 //
 //
 // QR Code 2005 uses a Reed-Solomon error correcting code to detect and correct
 // QR Code 2005 uses a Reed-Solomon error correcting code to detect and correct
 // errors encountered during decoding.
 // errors encountered during decoding.

+ 3 - 3
reedsolomon/reed_solomon_test.go

@@ -73,10 +73,10 @@ func TestEncode(t *testing.T) {
 	}
 	}
 
 
 	for _, test := range tests {
 	for _, test := range tests {
-		var data *bitset.Bitset = bitset.NewFromBase2String(test.data)
-		var rsCode *bitset.Bitset = bitset.NewFromBase2String(test.rsCode)
+		data := bitset.NewFromBase2String(test.data)
+		rsCode := bitset.NewFromBase2String(test.rsCode)
 
 
-		var result *bitset.Bitset = Encode(data, test.numECBytes)
+		result := Encode(data, test.numECBytes)
 
 
 		if !rsCode.Equals(result) {
 		if !rsCode.Equals(result) {
 			t.Errorf("data=%s, numECBytes=%d, encoded=%s, want %s",
 			t.Errorf("data=%s, numECBytes=%d, encoded=%s, want %s",