go-tinyqr

An experimental minimal QR Code generator  http://go-qrcode.appspot.com
git clone https://git.ce9e.org/go-tinyqr.git

commit
5bfceac8c4950ff8f735525ddcde5a6b08d77ab6
parent
a4b2f114dec145b66dde2e9b793495b74a67abe1
Author
Skip <tfh@skip.org>
Date
2016-01-24 02:09
Merge pull request #2 from shawnps/gofmt

gofmt -s

Diffstat

M bitset/bitset_test.go 12 ++++++------
M qrcode.go 2 +-
M qrcode_decode_test.go 3 +--
M qrcode_test.go 4 ++--
M symbol.go 6 +++---

5 files changed, 13 insertions, 14 deletions


diff --git a/bitset/bitset_test.go b/bitset/bitset_test.go

@@ -10,12 +10,12 @@ import (
   10    10 
   11    11 func TestNewBitset(t *testing.T) {
   12    12 	tests := [][]bool{
   13    -1 		[]bool{},
   14    -1 		[]bool{b1},
   15    -1 		[]bool{b0},
   16    -1 		[]bool{b1, b0},
   17    -1 		[]bool{b1, b0, b1},
   18    -1 		[]bool{b0, b0, b1},
   -1    13 		{},
   -1    14 		{b1},
   -1    15 		{b0},
   -1    16 		{b1, b0},
   -1    17 		{b1, b0, b1},
   -1    18 		{b0, b0, b1},
   19    19 	}
   20    20 
   21    21 	for _, v := range tests {

diff --git a/qrcode.go b/qrcode.go

@@ -101,7 +101,7 @@ type QRCode struct {
  101   101 
  102   102 	data   *bitset.Bitset
  103   103 	symbol *symbol
  104    -1 	mask int
   -1   104 	mask   int
  105   105 }
  106   106 
  107   107 // New constructs a QRCode.

diff --git a/qrcode_decode_test.go b/qrcode_decode_test.go

@@ -154,7 +154,7 @@ func TestDecodeFuzz(t *testing.T) {
  154   154 		for j := 0; j < len; j++ {
  155   155 			// zbarimg seems to have trouble with special characters, test printable
  156   156 			// characters only for now.
  157    -1 			content += string(32+r.Intn(94))
   -1   157 			content += string(32 + r.Intn(94))
  158   158 		}
  159   159 
  160   160 		for _, level := range []RecoveryLevel{Low, Medium, High, Highest} {
@@ -230,4 +230,3 @@ func BenchmarkDecodeTest(b *testing.B) {
  230   230 		}
  231   231 	}
  232   232 }
  233    -1 

diff --git a/qrcode_test.go b/qrcode_test.go

@@ -14,7 +14,7 @@ func TestQRCodeMaxCapacity(t *testing.T) {
   14    14 	}
   15    15 
   16    16 	tests := []struct {
   17    -1 		string string
   -1    17 		string         string
   18    18 		numRepetitions int
   19    19 	}{
   20    20 		{
@@ -155,7 +155,7 @@ func TestQRCodeISOAnnexIExample(t *testing.T) {
  155   155 
  156   156 	if q.mask != 2 {
  157   157 		t.Errorf("ISO Annex I example mask got %d, expected %d\n", q.mask,
  158    -1 		expectedMask)
   -1   158 			expectedMask)
  159   159 	}
  160   160 }
  161   161 

diff --git a/symbol.go b/symbol.go

@@ -81,7 +81,7 @@ func (m *symbol) numEmptyModules() int {
   81    81 	var count int
   82    82 	for y := 0; y < m.symbolSize; y++ {
   83    83 		for x := 0; x < m.symbolSize; x++ {
   84    -1 			if !m.isUsed[y + m.quietZoneSize][x + m.quietZoneSize] {
   -1    84 			if !m.isUsed[y+m.quietZoneSize][x+m.quietZoneSize] {
   85    85 				count++
   86    86 			}
   87    87 		}
@@ -252,7 +252,7 @@ func (m *symbol) penalty3() int {
  252   252 				penalty += penaltyWeight3
  253   253 				bitBuffer = 0xFF
  254   254 			default:
  255    -1 				if x == m.symbolSize - 1 && (bitBuffer & 0x7f) == 0x5d {
   -1   255 				if x == m.symbolSize-1 && (bitBuffer&0x7f) == 0x5d {
  256   256 					penalty += penaltyWeight3
  257   257 					bitBuffer = 0xFF
  258   258 				}
@@ -276,7 +276,7 @@ func (m *symbol) penalty3() int {
  276   276 				penalty += penaltyWeight3
  277   277 				bitBuffer = 0xFF
  278   278 			default:
  279    -1 				if y == m.symbolSize - 1 && (bitBuffer & 0x7f) == 0x5d {
   -1   279 				if y == m.symbolSize-1 && (bitBuffer&0x7f) == 0x5d {
  280   280 					penalty += penaltyWeight3
  281   281 					bitBuffer = 0xFF
  282   282 				}