Repository: exercism/xgo
Pull request #322 (2016-04-28 03:01:19)

new exercise to encode/decode variable length quantity
I'm not sure if that shouldn't move this exercise as a problem. I feel that the problem should be more defined so people understand the goal of the exercise.


Patch:
diff --git a/.gitignore b/.gitignore
index dc7141bb..733af6ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*.beam
 *.swp
 .DS_Store
 tmp
diff --git a/.travis.yml b/.travis.yml
index 57ee9751..cca6c7fb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,8 +19,7 @@ sudo: false
 # These additional versions will not be required, so they're advisory only.
 # Since Travis runs five jobs at a time, a limit of ten jobs makes sense.
 go:
-  - 1.7
-  - 1.6.3
+  - 1.6.2
   - 1.5.4
   - 1.4.3
   - tip
@@ -66,4 +65,3 @@ matrix:
   allow_failures:
     - go: tip
     - go: 1.4.3
-    - go: 1.5.4
diff --git a/README.md b/README.md
index d3331d84..afc1c92f 100644
--- a/README.md
+++ b/README.md
@@ -125,6 +125,3 @@ directions being tried.  Your fresh ideas and contributions are welcome.  :spark
 The MIT License (MIT)
 
 Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
-
-### Go icon
-The Go logo was designed by Renée French, and has been released under the Creative Commons 3.0 Attributions license.
diff --git a/config.json b/config.json
index 9ff4af30..5d217b2d 100644
--- a/config.json
+++ b/config.json
@@ -42,6 +42,7 @@
     "circular-buffer",
     "robot-name",
     "react",
+    "counter",
     "custom-set",
     "atbash-cipher",
     "phone-number",
@@ -74,12 +75,12 @@
     "word-search",
     "connect",
     "ledger",
-    "poker"
+    "poker",
+    "variable-length-quantity"
   ],
   "deprecated": [
     "accumulate",
     "bottles",
-    "counter",
     "point-mutations"
   ],
   "ignored": [
diff --git a/docs/ABOUT.md b/docs/ABOUT.md
index fbf1ffb2..4d037b83 100644
--- a/docs/ABOUT.md
+++ b/docs/ABOUT.md
@@ -1,4 +1,4 @@
-Go is an open source programming language started by engineers at Google. It's written using a C-style syntax, has statically typed variables, manages memory using garbage collection, and is compiled into stand-alone executables.
+Go is a an open source programming language started by engineers at Google. It's written using a C-style syntax, has statically typed variables, manages memory using garbage collection, and is compiled into stand-alone executables.
 
 Go is noted for the [concurrent programming features](https://golang.org/doc/effective_go.html#concurrency) built into the language core, the networking packages in the standard library ([such as a web server](https://golang.org/pkg/net/http/)), fast compilation and execution speed, and its simple, minimalistic language design.
 
diff --git a/docs/LEARNING.md b/docs/LEARNING.md
index 093bb9f9..aea46f17 100644
--- a/docs/LEARNING.md
+++ b/docs/LEARNING.md
@@ -2,7 +2,6 @@ Exercism provides exercises and feedback but can be difficult to jump into for t
 
 * [A Tour of Go](http://tour.golang.org)
 * [Go By Example](https://gobyexample.com/)
-* [Effective Go](https://golang.org/doc/effective_go.html)
 * [Go Language Specification](http://golang.org/ref/spec)
 * [Go Standard Library](http://golang.org/pkg/)
 * [Go Resources](http://golang.org/help)
diff --git a/exercises/allergies/example.go b/exercises/allergies/example.go
index 09c2544c..f02ea2b3 100644
--- a/exercises/allergies/example.go
+++ b/exercises/allergies/example.go
@@ -2,11 +2,9 @@ package allergies
 
 import "math"
 
-const testVersion = 1
-
 var allergens = []string{"eggs", "peanuts", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"}
 
-func Allergies(i uint) (result []string) {
+func Allergies(i int) (result []string) {
 	for _, v := range allergens {
 		if AllergicTo(i, v) {
 			result = append(result, []string{v}...)
@@ -15,9 +13,9 @@ func Allergies(i uint) (result []string) {
 	return result
 }
 
-func AllergicTo(i uint, allergen string) bool {
+func AllergicTo(i int, allergen string) bool {
 	index := indexOf(allergens, allergen)
-	x := uint(math.Pow(2.0, float64(index)))
+	x := int(math.Pow(2.0, float64(index)))
 	return (i & x) > 0
 }
 
diff --git a/exercises/beer-song/example.go b/exercises/beer-song/example.go
index 811c3ecf..afcc5170 100644
--- a/exercises/beer-song/example.go
+++ b/exercises/beer-song/example.go
@@ -5,8 +5,6 @@ import (
 	"fmt"
 )
 
-const testVersion = 1
-
 // Song returns the full lyrics for 99 bottles of beer
 func Song() (result string) {
 	result, _ = Verses(99, 0)
diff --git a/exercises/binary/example.go b/exercises/binary/example.go
index 7990a697..d373afa0 100644
--- a/exercises/binary/example.go
+++ b/exercises/binary/example.go
@@ -4,7 +4,7 @@ import (
 	"fmt"
 )
 
-const testVersion = 2
+const testVersion = 1
 
 // ParseBinary converts a binary string to an integer value
 func ParseBinary(bin string) (int, error) {
diff --git a/exercises/bracket-push/example.go b/exercises/bracket-push/example.go
index ce24f7ff..937340c4 100644
--- a/exercises/bracket-push/example.go
+++ b/exercises/bracket-push/example.go
@@ -5,7 +5,7 @@ import (
 )
 
 // testVersion shows the version of the exercise.
-const testVersion = 4
+const testVersion = 3
 
 type bracketKind int
 
diff --git a/exercises/circular-buffer/example.go b/exercises/circular-buffer/example.go
index 7bd9ca7a..ab5eef7c 100644
--- a/exercises/circular-buffer/example.go
+++ b/exercises/circular-buffer/example.go
@@ -8,7 +8,7 @@ import (
 	"errors"
 )
 
-const testVersion = 4
+const testVersion = 3
 
 // Buffer implements a circular buffer supporting both overflow-checked writes
 // and unconditional, possibly overwriting, writes.
diff --git a/exercises/clock/clock.go b/exercises/clock/clock.go
index 77285ae5..7e6a3d4f 100644
--- a/exercises/clock/clock.go
+++ b/exercises/clock/clock.go
@@ -6,7 +6,7 @@ package clock
 
 // The value of testVersion here must match `targetTestVersion` in the file
 // clock_test.go.
-const testVersion = 4
+const testVersion = 3
 
 // Clock API as stub definitions.  No, it doesn't compile yet.
 // More details and hints are in clock_test.go.
diff --git a/exercises/connect/example.go b/exercises/connect/example.go
index 77e2d82b..adf076cc 100644
--- a/exercises/connect/example.go
+++ b/exercises/connect/example.go
@@ -6,8 +6,6 @@ import (
 	"strings"
 )
 
-const testVersion = 3
-
 const (
 	white = 1 << iota
 	black
@@ -180,12 +178,12 @@ func ResultOf(lines []string) (string, error) {
 	}
 	for _, c := range board.startCoords(flagsBlack) {
 		if board.evaluate(c, flagsBlack) {
-			return "X", nil
+			return "black", nil
 		}
 	}
 	for _, c := range board.startCoords(flagsWhite) {
 		if board.evaluate(c, flagsWhite) {
-			return "O", nil
+			return "white", nil
 		}
 	}
 	return "", nil
diff --git a/exercises/connect/example_gen.go b/exercises/connect/example_gen.go
deleted file mode 100644
index 9369d027..00000000
--- a/exercises/connect/example_gen.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// +build ignore
-
-package main
-
-import (
-	"log"
-	"text/template"
-
-	"../../gen"
-)
-
-func main() {
-	t, err := template.New("").Parse(tmpl)
-	if err != nil {
-		log.Fatal(err)
-	}
-	var j js
-	if err := gen.Gen("connect.json", &j, t); err != nil {
-		log.Fatal(err)
-	}
-}
-
-// The JSON structure we expect to be able to unmarshal into
-type js struct {
-	Cases []struct {
-		Description string
-		Board       []string
-		Expected    string
-	}
-}
-
-// template applied to above data structure generates the Go test cases
-var tmpl = `package connect
-
-// Source: {{.Ori}}
-{{if .Commit}}// Commit: {{.Commit}}
-{{end}}
-
-var testCases = []struct {
-    description string
-    board       []string
-    expected    string
-}{
-	{{range .J.Cases}}{
-		description: {{printf "%q" .Description}},
-		board: []string{ {{range $line := .Board}}{{printf "\n    %q," $line}}{{end}}},
-		expected: {{printf "%q" .Expected}},
-},
-{{end}}}
-`
diff --git a/exercises/grains/example.go b/exercises/grains/example.go
index 2177bbd0..a68932d7 100644
--- a/exercises/grains/example.go
+++ b/exercises/grains/example.go
@@ -4,8 +4,6 @@ import (
 	"fmt"
 )
 
-const testVersion = 1
-
 // Square returns the number of grains on a square on a chess board where the
 // first square has 1 and every subsequent square doubles the number.
 func Square(num int) (uint64, error) {
diff --git a/exercises/hexadecimal/example.go b/exercises/hexadecimal/example.go
index 66b33624..ff5aa716 100644
--- a/exercises/hexadecimal/example.go
+++ b/exercises/hexadecimal/example.go
@@ -8,8 +8,6 @@ import (
 	"math"
 )
 
-const testVersion = 1
-
 // ErrRange indicates that a value is out of range for the target type.
 var ErrRange = errors.New("value out of range")
 
diff --git a/exercises/queen-attack/example.go b/exercises/queen-attack/example.go
index 57a63f7c..aad04a5e 100644
--- a/exercises/queen-attack/example.go
+++ b/exercises/queen-attack/example.go
@@ -2,8 +2,6 @@ package queenattack
 
 import "fmt"
 
-const testVersion = 1
-
 func CanQueenAttack(w, b string) (attack bool, err error) {
 	if err = valSq(w); err != nil {
 		return false, err
diff --git a/exercises/secret-handshake/example.go b/exercises/secret-handshake/example.go
index f92b8a95..866d4640 100644
--- a/exercises/secret-handshake/example.go
+++ b/exercises/secret-handshake/example.go
@@ -1,11 +1,9 @@
 package secret
 
-const testVersion = 1
-
 var signals = []string{"wink", "double blink", "close your eyes", "jump"}
 
 // Handshake returns sequence to perform corresponding to the given code.
-func Handshake(code uint) (h []string) {
+func Handshake(code int) (h []string) {
 	switch {
 	case code < 1:
 	case code&16 == 0:
diff --git a/exercises/series/example.go b/exercises/series/example.go
index 80ef9061..d0622773 100644
--- a/exercises/series/example.go
+++ b/exercises/series/example.go
@@ -8,6 +8,6 @@ func All(n int, s string) (r []string) {
 	return
 }
 
-func UnsafeFirst(n int, s string) string {
+func Frist(n int, s string) string {
 	return s[:n]
 }
diff --git a/exercises/tournament/example.go b/exercises/tournament/example.go
index 1c449b26..1e4cabc7 100644
--- a/exercises/tournament/example.go
+++ b/exercises/tournament/example.go
@@ -7,7 +7,7 @@ import (
 	"sort"
 )
 
-const testVersion = 4
+const testVersion = 3
 
 type outcome int
 
diff --git a/exercises/triangle/example.go b/exercises/triangle/example.go
index df68f752..0c85b1c1 100644
--- a/exercises/triangle/example.go
+++ b/exercises/triangle/example.go
@@ -4,7 +4,7 @@ import "math"
 
 type Kind string
 
-const testVersion = 3
+const testVersion = 2
 
 const (
 	Equ Kind = "equilateral"
diff --git a/exercises/trinary/example.go b/exercises/trinary/example.go
index c54e7d69..8178707e 100644
--- a/exercises/trinary/example.go
+++ b/exercises/trinary/example.go
@@ -5,8 +5,6 @@ import (
 	"math"
 )
 
-const testVersion = 1
-
 func ParseTrinary(s string) (int64, error) {
 	const third = math.MaxInt64 / 3
 	overflow := false
diff --git a/exercises/variable-length-quantity/example.go b/exercises/variable-length-quantity/example.go
new file mode 100644
index 00000000..945c4966
--- /dev/null
+++ b/exercises/variable-length-quantity/example.go
@@ -0,0 +1,56 @@
+package variablelengthquantity
+
+// EncodeVarint returns the varint encoding of x.
+func EncodeVarint(x uint32) []byte {
+	if x>>7 == 0 {
+		return []byte{
+			byte(x),
+		}
+	}
+
+	if x>>14 == 0 {
+		return []byte{
+			byte(0x80 | x>>7),
+			byte(127 & x),
+		}
+	}
+
+	if x>>21 == 0 {
+		return []byte{
+			byte(0x80 | x>>14),
+			byte(0x80 | x>>7),
+			byte(127 & x),
+		}
+	}
+
+	return []byte{
+		byte(0x80 | x>>21),
+		byte(0x80 | x>>14),
+		byte(0x80 | x>>7),
+		byte(127 & x),
+	}
+}
+
+// DecodeVarint reads a varint-encoded integer from the slice.
+// It returns the integer and the number of bytes consumed, or
+// zero if there is not enough.
+func DecodeVarint(buf []byte) (x uint32, n int) {
+	if len(buf) < 1 {
+		return 0, 0
+	}
+
+	if buf[0] <= 0x80 {
+		return uint32(buf[0]), 1
+	}
+
+	var b byte
+	for n, b = range buf {
+		x = x << 7
+		x |= uint32(b) & 0x7F
+		if (b & 0x80) == 0 {
+			return x, n
+		}
+	}
+
+	return x, n
+}
diff --git a/exercises/word-search/example.go b/exercises/word-search/example.go
index 07bd19c0..0949cec3 100644
--- a/exercises/word-search/example.go
+++ b/exercises/word-search/example.go
@@ -2,7 +2,7 @@ package wordsearch
 
 import "fmt"
 
-const testVersion = 3
+const testVersion = 2
 
 func Solve(words []string, puzzle []string) (map[string][2][2]int, error) {
 	positions := make(map[string][2][2]int, len(words))


Test patch:
diff --git a/exercises/accumulate/accumulate_test.go b/exercises/accumulate/accumulate_test.go
index 16f76f5f..c3fe446a 100644
--- a/exercises/accumulate/accumulate_test.go
+++ b/exercises/accumulate/accumulate_test.go
@@ -23,14 +23,14 @@ var tests = []struct {
 	{[]string{}, []string{}, echo, "echo"},
 	{[]string{"echo", "echo", "echo", "echo"}, []string{"echo", "echo", "echo", "echo"}, echo, "echo"},
 	{[]string{"First", "Letter", "Only"}, []string{"first", "letter", "only"}, capitalize, "capitalize"},
-	{[]string{"HELLO", "WORLD"}, []string{"hello", "world"}, strings.ToUpper, "strings.ToUpper"},
+	{[]string{"HELLO", "WORLD"}, []string{"hello", "world"}, strings.ToUpper, "upcase"},
 }
 
 func TestAccumulate(t *testing.T) {
 	for _, test := range tests {
 		actual := Accumulate(test.given, test.converter)
 		if fmt.Sprintf("%s", actual) != fmt.Sprintf("%s", test.expected) {
-			t.Fatalf("Accumulate(%s, %s): expected %s, actual %s", test.given, test.description, test.expected, actual)
+			t.Fatalf("Accumulate(%s, %#v): expected %s, actual %s", test.given, test.converter, test.expected, actual)
 		} else {
 			t.Logf("PASS: %s %v", test.description, test.given)
 		}
diff --git a/exercises/allergies/allergies_test.go b/exercises/allergies/allergies_test.go
index 85debf4c..51200350 100644
--- a/exercises/allergies/allergies_test.go
+++ b/exercises/allergies/allergies_test.go
@@ -2,15 +2,12 @@ package allergies
 
 import (
 	"fmt"
-	"sort"
 	"testing"
 )
 
-const targetTestVersion = 1
-
 var allergiesTests = []struct {
 	expected []string
-	input    uint
+	input    int
 }{
 	{[]string{}, 0},
 	{[]string{"eggs"}, 1},
@@ -24,13 +21,8 @@ var allergiesTests = []struct {
 }
 
 func TestAllergies(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
-	}
 	for _, test := range allergiesTests {
 		actual := Allergies(test.input)
-		sort.Strings(actual)
-		sort.Strings(test.expected)
 		if fmt.Sprintf("%s", actual) != fmt.Sprintf("%s", test.expected) {
 			t.Fatalf("FAIL: Allergies(%d): expected %s, actual %s", test.input, test.expected, actual)
 		} else {
@@ -53,7 +45,7 @@ func BenchmarkAllergies(b *testing.B) {
 
 var allergicToTests = []struct {
 	expected bool
-	i        uint
+	i        int
 	allergen string
 }{
 	{false, 0, "peanuts"},
diff --git a/exercises/bank-account/bank_account_test.go b/exercises/bank-account/bank_account_test.go
index 26e5b2c2..82d8ea3c 100644
--- a/exercises/bank-account/bank_account_test.go
+++ b/exercises/bank-account/bank_account_test.go
@@ -3,7 +3,7 @@
 // Open(initalDeposit int64) *Account
 // (Account) Close() (payout int64, ok bool)
 // (Account) Balance() (balance int64, ok bool)
-// (Account) Deposit(amount int64) (newBalance int64, ok bool)
+// (Account) Deposit(amount uint64) (newBalance int64, ok bool)
 //
 // If Open is given a negative initial deposit, it must return nil.
 // Deposit must handle a negative amount as a withdrawal.
diff --git a/exercises/beer-song/beer_test.go b/exercises/beer-song/beer_test.go
index 57824043..38809c85 100644
--- a/exercises/beer-song/beer_test.go
+++ b/exercises/beer-song/beer_test.go
@@ -4,14 +4,6 @@ import (
 	"testing"
 )
 
-const targetTestVersion = 1
-
-func TestTestVersion(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
-	}
-}
-
 const verse8 = "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n"
 const verse3 = "3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n"
 const verse2 = "2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n"
@@ -57,23 +49,17 @@ var verseTestCases = []struct {
 func TestBottlesVerse(t *testing.T) {
 	for _, tt := range verseTestCases {
 		actualVerse, err := Verse(tt.verse)
-		if tt.expectErr {
-			// check if err is of error type
-			var _ error = err
-
-			// if we expect an error and there isn't one
-			if err == nil {
-				t.Errorf("Verse(%d): expected an error, but error is nil", tt.verse)
-			}
-		} else {
-			if actualVerse != tt.expectedVerse {
-				t.Fatalf("Verse(%d):\nexpected\n%s\nactual\n%s", tt.verse, tt.expectedVerse, actualVerse)
-			}
-
-			// if we don't expect an error and there is one
-			if err != nil {
-				t.Errorf("Verse(%d): expected no error, but error is: %s", tt.verse, err)
-			}
+		if actualVerse != tt.expectedVerse {
+			t.Fatalf("Verse(%d):\nexpected\n%s\nactual\n%s", tt.verse, tt.expectedVerse, actualVerse)
+		}
+
+		// if we expect an error and there isn't one
+		if tt.expectErr && err == nil {
+			t.Errorf("Verse(%d): expected an error, but error is nil", tt.verse)
+		}
+		// if we don't expect an error and there is one
+		if !tt.expectErr && err != nil {
+			t.Errorf("Verse(%d): expected no error, but error is: %s", tt.verse, err)
 		}
 	}
 }
@@ -96,23 +82,16 @@ func TestSeveralVerses(t *testing.T) {
 
 	for _, tt := range versesTestCases {
 		actualVerse, err := Verses(tt.upperBound, tt.lowerBound)
-		if tt.expectErr {
-			// check if err is of error type
-			var _ error = err
-
-			// if we expect an error and there isn't one
-			if err == nil {
-				t.Errorf("Verses(%d, %d): expected an error, but error is nil", tt.upperBound, tt.lowerBound)
-			}
-		} else {
-			if actualVerse != tt.expectedVerse {
-				t.Fatalf("Verses(%d, %d):\nexpected\n%s\nactual\n%s", tt.upperBound, tt.lowerBound, tt.expectedVerse, actualVerse)
-			}
-
-			// if we don't expect an error and there is one
-			if err != nil {
-				t.Errorf("Verses(%d, %d): expected no error, but error is: %s", tt.upperBound, tt.lowerBound, err)
-			}
+		if actualVerse != tt.expectedVerse {
+			t.Fatalf("Verses(%d, %d):\nexpected\n%s\nactual\n%s", tt.upperBound, tt.lowerBound, tt.expectedVerse, actualVerse)
+		}
+		// if we expect an error and there isn't one
+		if tt.expectErr && err == nil {
+			t.Errorf("Verses(%d, %d): expected an error, but error is nil", tt.upperBound, tt.lowerBound)
+		}
+		// if we don't expect an error and there is one
+		if !tt.expectErr && err != nil {
+			t.Errorf("Verses(%d, %d): expected no error, but error is: %s", tt.upperBound, tt.lowerBound, err)
 		}
 	}
 }
@@ -132,7 +111,6 @@ func BenchmarkSeveralVerses(b *testing.B) {
 
 func TestEntireSong(t *testing.T) {
 	expected, err := Verses(99, 0)
-	var _ error = err
 	if err != nil {
 		t.Fatalf("unexpected error calling Verses(99,0)")
 	}
diff --git a/exercises/binary-search-tree/binary_search_tree_test.go b/exercises/binary-search-tree/binary_search_tree_test.go
index e419d771..062dca8a 100644
--- a/exercises/binary-search-tree/binary_search_tree_test.go
+++ b/exercises/binary-search-tree/binary_search_tree_test.go
@@ -1,16 +1,3 @@
-// API:
-//
-// type SearchTreeData struct {
-//	left  *SearchTreeData
-//	data  int
-//	right *SearchTreeData
-// }
-//
-// func Bst(int) *SearchTreeData
-// func (*SearchTreeData) Insert(int)
-// func (*SearchTreeData) MapString(func(int) string) []string
-// func (*SearchTreeData) MapInt(func(int) int) []int
-
 package binarysearchtree
 
 import (
diff --git a/exercises/binary/binary_test.go b/exercises/binary/binary_test.go
index 0bd2b4a4..cd5af58f 100644
--- a/exercises/binary/binary_test.go
+++ b/exercises/binary/binary_test.go
@@ -17,12 +17,12 @@ import (
 // Also define a testVersion with a value that matches
 // the targetTestVersion here.
 
-const targetTestVersion = 2
+const targetTestVersion = 1
 
 var testCases = []struct {
 	binary   string
 	expected int
-	ok       bool
+	ok bool
 }{
 	{"1", 1, true},
 	{"10", 2, true},
@@ -39,14 +39,10 @@ var testCases = []struct {
 }
 
 func TestParseBinary(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
-	}
 	for _, tt := range testCases {
 		actual, err := ParseBinary(tt.binary)
 		if tt.ok {
 			if err != nil {
-				var _ error = err
 				t.Fatalf("ParseBinary(%v) returned error %q.  Error not expected.",
 					tt.binary, err)
 			}
diff --git a/exercises/bracket-push/bracket_push_test.go b/exercises/bracket-push/bracket_push_test.go
index 5e2e27b9..6f928775 100644
--- a/exercises/bracket-push/bracket_push_test.go
+++ b/exercises/bracket-push/bracket_push_test.go
@@ -4,7 +4,7 @@ import (
 	"testing"
 )
 
-const targetTestVersion = 4
+const targetTestVersion = 3
 
 var testCases = []struct {
 	input    string
@@ -49,14 +49,10 @@ var testCases = []struct {
 }
 
 func TestBracket(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Fatalf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
-	}
 	for _, tt := range testCases {
 		actual, err := Bracket(tt.input)
 		// We don't expect errors for any of the test cases
 		if err != nil {
-			var _ error = err
 			t.Fatalf("Bracket(%q) returned error %q.  Error not expected.", tt.input, err)
 		}
 		if actual != tt.expected {
@@ -64,6 +60,9 @@ func TestBracket(t *testing.T) {
 				tt.input, tt.expected, actual)
 		}
 	}
+	if testVersion != targetTestVersion {
+		t.Fatalf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
+	}
 }
 
 func BenchmarkBracket(b *testing.B) {
diff --git a/exercises/circular-buffer/circular_buffer_test.go b/exercises/circular-buffer/circular_buffer_test.go
index 4215b210..7eda50fe 100644
--- a/exercises/circular-buffer/circular_buffer_test.go
+++ b/exercises/circular-buffer/circular_buffer_test.go
@@ -19,7 +19,7 @@ import (
 	"testing"
 )
 
-const targetTestVersion = 4
+const targetTestVersion = 3
 
 func TestTestVersion(t *testing.T) {
 	if testVersion != targetTestVersion {
@@ -48,7 +48,6 @@ func nb(size int, t *testing.T) testBuffer {
 func (tb testBuffer) read(want byte) {
 	switch c, err := tb.b.ReadByte(); {
 	case err != nil:
-		var _ error = err
 		tb.Fatalf("ReadByte() failed unexpectedly: %v", err)
 	case c != want:
 		tb.Fatalf("ReadByte() = %c, want %c.", c, want)
@@ -57,28 +56,23 @@ func (tb testBuffer) read(want byte) {
 }
 
 func (tb testBuffer) readFail() {
-	c, err := tb.b.ReadByte()
-	if err == nil {
+	if c, err := tb.b.ReadByte(); err == nil {
 		tb.Fatalf("ReadByte() = %c, expected a failure", c)
 	}
-	var _ error = err
 	tb.Log("ReadByte() fails as expected")
 }
 
 func (tb testBuffer) write(c byte) {
 	if err := tb.b.WriteByte(c); err != nil {
-		var _ error = err
 		tb.Fatalf("WriteByte(%c) failed unexpectedly: %v", c, err)
 	}
 	tb.Logf("WriteByte(%c)", c)
 }
 
 func (tb testBuffer) writeFail(c byte) {
-	err := tb.b.WriteByte(c)
-	if err == nil {
+	if err := tb.b.WriteByte(c); err == nil {
 		tb.Fatalf("WriteByte(%c) succeeded, expected a failure", c)
 	}
-	var _ error = err
 	tb.Logf("WriteByte(%c) fails as expected", c)
 }
 
diff --git a/exercises/connect/cases_test.go b/exercises/connect/cases_test.go
deleted file mode 100644
index 703e5c65..00000000
--- a/exercises/connect/cases_test.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package connect
-
-// Source: exercism/x-common
-// Commit: 038124b triangle: Add JSON test data
-
-var testCases = []struct {
-	description string
-	board       []string
-	expected    string
-}{
-	{
-		description: "an empty board has no winner",
-		board: []string{
-			". . . . .",
-			" . . . . .",
-			"  . . . . .",
-			"   . . . . .",
-			"    . . . . ."},
-		expected: "",
-	},
-	{
-		description: "X can win on a 1x1 board",
-		board: []string{
-			"X"},
-		expected: "X",
-	},
-	{
-		description: "O can win on a 1x1 board",
-		board: []string{
-			"O"},
-		expected: "O",
-	},
-	{
-		description: "only edges does not make a winner",
-		board: []string{
-			"O O O X",
-			" X . . X",
-			"  X . . X",
-			"   X O O O"},
-		expected: "",
-	},
-	{
-		description: "illegal diagonal does not make a winner",
-		board: []string{
-			"X O . .",
-			" O X X X",
-			"  O X O .",
-			"   . O X .",
-			"    X X O O"},
-		expected: "",
-	},
-	{
-		description: "nobody wins crossing adjacent angles",
-		board: []string{
-			"X . . .",
-			" . X O .",
-			"  O . X O",
-			"   . O . X",
-			"    . . O ."},
-		expected: "",
-	},
-	{
-		description: "X wins crossing from left to right",
-		board: []string{
-			". O . .",
-			" O X X X",
-			"  O X O .",
-			"   X X O X",
-			"    . O X ."},
-		expected: "X",
-	},
-	{
-		description: "O wins crossing from top to bottom",
-		board: []string{
-			". O . .",
-			" O X X X",
-			"  O O O .",
-			"   X X O X",
-			"    . O X ."},
-		expected: "O",
-	},
-	{
-		description: "X wins using a convoluted path",
-		board: []string{
-			". X X . .",
-			" X . X . X",
-			"  . X . X .",
-			"   . X X . .",
-			"    O O O O O"},
-		expected: "X",
-	},
-	{
-		description: "X wins using a spiral path",
-		board: []string{
-			"O X X X X X X X X",
-			" O X O O O O O O O",
-			"  O X O X X X X X O",
-			"   O X O X O O O X O",
-			"    O X O X X X O X O",
-			"     O X O O O X O X O",
-			"      O X X X X X O X O",
-			"       O O O O O O O X O",
-			"        X X X X X X X X O"},
-		expected: "X",
-	},
-}
diff --git a/exercises/connect/connect_test.go b/exercises/connect/connect_test.go
index ce57ddd3..8b1668db 100644
--- a/exercises/connect/connect_test.go
+++ b/exercises/connect/connect_test.go
@@ -5,6 +5,101 @@ import (
 	"testing"
 )
 
+var testCases = []struct {
+	description string
+	lines       []string
+	expected    string
+}{
+	{
+		description: "empty board has no winner",
+		lines: []string{
+			". . . . .",
+			" . . . . .",
+			"  . . . . .",
+			"   . . . . .",
+			"    . . . . .",
+		},
+		expected: "",
+	},
+	{
+		description: "1x1 board, black",
+		lines: []string{
+			"X",
+		},
+		expected: "black",
+	},
+	{
+		description: "1x1 board, white",
+		lines: []string{
+			"O",
+		},
+		expected: "white",
+	},
+	{
+		description: "convulted path",
+		lines: []string{
+			". X X . .",
+			" X . X . X",
+			"  . X . X .",
+			"   . X X . .",
+			"    O O O O O",
+		},
+		expected: "black",
+	},
+	{
+		description: "rectangle, white wins",
+		lines: []string{
+			". O . .",
+			" O X X X",
+			"  O O O .",
+			"   X X O X",
+			"    . O X .",
+		},
+		expected: "white",
+	},
+	{
+		description: "rectangle, black wins",
+		lines: []string{
+			". O . .",
+			" O X X X",
+			"  O X O .",
+			"   X X O X",
+			"    . O X .",
+		},
+		expected: "black",
+	},
+	{
+		description: "spiral, black wins",
+		lines: []string{
+			"OXXXXXXXX",
+			"OXOOOOOOO",
+			"OXOXXXXXO",
+			"OXOXOOOXO",
+			"OXOXXXOXO",
+			"OXOOOXOXO",
+			"OXXXXXOXO",
+			"OOOOOOOXO",
+			"XXXXXXXXO",
+		},
+		expected: "black",
+	},
+	{
+		description: "spiral, nobody wins",
+		lines: []string{
+			"OXXXXXXXX",
+			"OXOOOOOOO",
+			"OXOXXXXXO",
+			"OXOXOOOXO",
+			"OXOX.XOXO",
+			"OXOOOXOXO",
+			"OXXXXXOXO",
+			"OOOOOOOXO",
+			"XXXXXXXXO",
+		},
+		expected: "",
+	},
+}
+
 // Simply strip the spaces of all the strings to get a canonical
 // input. The spaces are only for readability of the tests.
 func prepare(lines []string) []string {
@@ -15,17 +110,11 @@ func prepare(lines []string) []string {
 	return newLines
 }
 
-const targetTestVersion = 3
-
 func TestResultOf(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
-	}
 	for _, tt := range testCases {
-		actual, err := ResultOf(prepare(tt.board))
+		actual, err := ResultOf(prepare(tt.lines))
 		// We don't expect errors for any of the test cases
 		if err != nil {
-			var _ error = err
 			t.Fatalf("ResultOf for board %q returned error %q.  Error not expected.",
 				tt.description, err)
 		}
@@ -41,7 +130,7 @@ func BenchmarkResultOf(b *testing.B) {
 	b.StopTimer()
 
 	for _, tt := range testCases {
-		board := prepare(tt.board)
+		board := prepare(tt.lines)
 		b.StartTimer()
 
 		for i := 0; i < b.N; i++ {
diff --git a/exercises/etl/etl_test.go b/exercises/etl/etl_test.go
index d52af108..70cb93e9 100644
--- a/exercises/etl/etl_test.go
+++ b/exercises/etl/etl_test.go
@@ -67,7 +67,7 @@ func equal(actual map[string]int, expectation map[string]int) bool {
 	return true
 }
 
-func TestTransform(t *testing.T) {
+func TestTranform(t *testing.T) {
 	for _, tt := range transformTests {
 		actual := Transform(map[int][]string(tt.input))
 		if !equal(actual, tt.output) {
@@ -76,7 +76,7 @@ func TestTransform(t *testing.T) {
 	}
 }
 
-func BenchmarkTransform(b *testing.B) {
+func BenchmarkTranform(b *testing.B) {
 	b.StopTimer()
 	for _, tt := range transformTests {
 		b.StartTimer()
diff --git a/exercises/grade-school/grade_school_test.go b/exercises/grade-school/grade_school_test.go
index a827baff..5722305b 100644
--- a/exercises/grade-school/grade_school_test.go
+++ b/exercises/grade-school/grade_school_test.go
@@ -1,15 +1,3 @@
-// API:
-//
-// type Grade struct {
-// 	int, []string
-// }
-//
-// type School
-// func New() *School
-// func (s *School) Add(string, int)
-// func (s *School) Grade(int) []string
-// func (s *School) Enrollment() []Grade
-
 package school
 
 import (
diff --git a/exercises/grains/grains_test.go b/exercises/grains/grains_test.go
index dcaf4a1e..e37cdab7 100644
--- a/exercises/grains/grains_test.go
+++ b/exercises/grains/grains_test.go
@@ -4,8 +4,6 @@ import (
 	"testing"
 )
 
-const targetTestVersion = 1
-
 var squareTests = []struct {
 	input       int
 	expectedVal uint64
@@ -36,7 +34,6 @@ func TestSquare(t *testing.T) {
 		}
 		// if we don't expect an error and there is one
 		if !test.expectError && actualErr != nil {
-			var _ error = actualErr
 			t.Errorf("Square(%d) expected no error, but error is: %s", test.input, actualErr)
 		}
 	}
@@ -49,12 +46,6 @@ func TestTotal(t *testing.T) {
 	}
 }
 
-func TestTestVersion(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
-	}
-}
-
 func BenchmarkSquare(b *testing.B) {
 	b.StopTimer()
 
diff --git a/exercises/hexadecimal/hexadecimal_test.go b/exercises/hexadecimal/hexadecimal_test.go
index 673bff01..f0970578 100644
--- a/exercises/hexadecimal/hexadecimal_test.go
+++ b/exercises/hexadecimal/hexadecimal_test.go
@@ -11,18 +11,9 @@
 package hexadecimal
 
 import (
-	"strings"
 	"testing"
 )
 
-const targetTestVersion = 1
-
-func TestTestVersion(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
-	}
-}
-
 var testCases = []struct {
 	in      string
 	out     int64
@@ -43,34 +34,18 @@ var testCases = []struct {
 
 func TestParseHex(t *testing.T) {
 	for _, test := range testCases {
-		out, err := ParseHex(test.in)
-		if test.errCase != "none" {
-			// check if err is of error type
-			var _ error = err
-
-			// we expect error
-			if err == nil {
-				t.Errorf("ParseHex(%q): expected an error, but error is nil",
-					test.in)
-				continue
-			}
-
-			if !strings.Contains(strings.ToLower(err.Error()), test.errCase) {
-				t.Errorf(
-					"ParseHex(%q) returned error %q. Expected error containing '%s'.",
-					test.in, err, test.errCase)
-			}
-		} else {
-			if out != test.out {
-				t.Errorf("ParseHex(%q) = %d. Expected %d.",
-					test.in, out, test.out)
-			}
-
-			// we dont expect error
-			if err != nil {
+		switch out, err := ParseHex(test.in); {
+		case err != nil:
+			if test.errCase == "none" {
 				t.Errorf("ParseHex(%q) returned error %q.  Error not expected.",
 					test.in, err)
 			}
+		case test.errCase != "none":
+			t.Errorf("ParseHex(%q) = %d, %v. Expected error.",
+				test.in, out, err)
+		case out != test.out:
+			t.Errorf("ParseHex(%q) = %d. Expected %d.",
+				test.in, out, test.out)
 		}
 	}
 }
diff --git a/exercises/parallel-letter-frequency/parallel_letter_frequency_test.go b/exercises/parallel-letter-frequency/parallel_letter_frequency_test.go
index 99fed052..64e81da5 100644
--- a/exercises/parallel-letter-frequency/parallel_letter_frequency_test.go
+++ b/exercises/parallel-letter-frequency/parallel_letter_frequency_test.go
@@ -44,15 +44,3 @@ Gave proof through the night that our flag was still there;
 O say does that star-spangled banner yet wave,
 O'er the land of the free and the home of the brave?`
 )
-
-func BenchmarkSequentialFrequency(b *testing.B) {
-	for i := 0; i < b.N; i++ {
-		Frequency(euro + dutch + us)
-	}
-}
-
-func BenchmarkConcurrentFrequency(b *testing.B) {
-	for i := 0; i < b.N; i++ {
-		ConcurrentFrequency([]string{euro, dutch, us})
-	}
-}
diff --git a/exercises/queen-attack/queen_attack_test.go b/exercises/queen-attack/queen_attack_test.go
index 5534edd0..586b0606 100644
--- a/exercises/queen-attack/queen_attack_test.go
+++ b/exercises/queen-attack/queen_attack_test.go
@@ -5,8 +5,6 @@ import "testing"
 // Arguments to CanQueenAttack are in algebraic notation.
 // See http://en.wikipedia.org/wiki/Algebraic_notation_(chess)
 
-const targetTestVersion = 1
-
 var tests = []struct {
 	w, b   string
 	attack bool
@@ -26,17 +24,10 @@ var tests = []struct {
 	{"f1", "a6", true, true},
 }
 
-func TestTestVersion(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
-	}
-}
-
 func TestCanQueenAttack(t *testing.T) {
 	for _, test := range tests {
 		switch attack, err := CanQueenAttack(test.w, test.b); {
 		case err != nil:
-			var _ error = err
 			if test.ok {
 				t.Fatalf("CanQueenAttack(%s, %s) returned error %q.  "+
 					"Error not expected.",
diff --git a/exercises/secret-handshake/secret_handshake_test.go b/exercises/secret-handshake/secret_handshake_test.go
index 0f6ba650..65fd0583 100644
--- a/exercises/secret-handshake/secret_handshake_test.go
+++ b/exercises/secret-handshake/secret_handshake_test.go
@@ -5,10 +5,8 @@ import (
 	"testing"
 )
 
-const targetTestVersion = 1
-
 var tests = []struct {
-	code uint
+	code int
 	h    []string
 }{
 	{1, []string{"wink"}},
@@ -19,14 +17,12 @@ var tests = []struct {
 	{19, []string{"double blink", "wink"}},
 	{31, []string{"jump", "close your eyes", "double blink", "wink"}},
 	{0, nil},
+	{-1, nil},
 	{32, nil},
 	{33, []string{"wink"}},
 }
 
 func TestHandshake(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
-	}
 	for _, test := range tests {
 		h := Handshake(test.code)
 		// use len() to allow either nil or empty list, because
diff --git a/exercises/series/asktoomuch_test.go b/exercises/series/asktoomuch_test.go
index e29703a2..7ef092b2 100644
--- a/exercises/series/asktoomuch_test.go
+++ b/exercises/series/asktoomuch_test.go
@@ -8,21 +8,21 @@ func TestAskTooMuch(t *testing.T) {
 	test := allTests[0]
 	defer func() {
 		if recover() != nil {
-			t.Fatalf("Yikes, UnsafeFirst(%d, %s) panicked!", test.n, test.s)
+			t.Fatalf("Yikes, Frist(%d, %s) panicked!", test.n, test.s)
 		}
 	}()
 	for _, test = range allTests {
-		switch res := UnsafeFirst(test.n, test.s); {
+		switch res := Frist(test.n, test.s); {
 		case len(test.out) > 0: // well, this should work
 			if res != test.out[0] {
-				t.Fatalf("Yikes, UnsafeFirst(%d, %s) = %q, want %q.",
+				t.Fatalf("Yikes, Frist(%d, %s) = %q, want %q.",
 					test.n, test.s, res, test.out[0])
 			}
 		case len(res) != test.n:
-			t.Fatalf("Yikes, UnsafeFirst(%d, %s) = %q, but %q doesn't have %d characters.",
+			t.Fatalf("Yikes, Frist(%d, %s) = %q, but %q doesn't have %d characters.",
 				test.n, test.s, res, res, test.n)
 		default:
-			t.Fatalf("Yikes, UnsafeFirst(%d, %s) = %q, but %q isn't in %q",
+			t.Fatalf("Yikes, Frist(%d, %s) = %q, but %q isn't in %q",
 				test.n, test.s, res, res, test.s)
 		}
 	}
diff --git a/exercises/series/series_test.go b/exercises/series/series_test.go
index 682d78f0..03216fbd 100644
--- a/exercises/series/series_test.go
+++ b/exercises/series/series_test.go
@@ -3,29 +3,21 @@
 //    // All returns a list of all substrings of s with length n.
 //    All(n int, s string) []string
 //
-//    // UnsafeFirst returns the first substring of s with length n.
-//    UnsafeFirst(n int, s string) string
+//    // Frist returns the first substring of s with length n.
+//    Frist(n int, s string) string
 //
-// At this point you could consider this exercise complete and move on.
-// But wait, maybe you ask a reasonable question:
-// Why is the function called **Unsafe** First?
-// If you are interested, read on for a bonus exercise.
+// Wait, is that a typo?  It'll make sense if you do the bonus!
 //
 // Bonus exercise:
 //
-// Once you get `go test` passing, try `go test -tags asktoomuch`.
-// This uses a *build tag* to enable a test that wasn't enabled before.
-// You can read more about those at https://golang.org/pkg/go/build/#hdr-Build_Constraints
+// Maybe we typed too fast.  Once you get `go test` passing, try
+// `go test -tags asktoomuch`.  (Hint, you can't make it happy.)
 //
-// You may notice that you can't make this asktoomuch test happy.
-// We need a way to signal that in some cases you can't take the first N characters of the string.
-// UnsafeFirst can't do that since it only returns a string.
-//
-// To fix that, let's add another return value to the function.  Define
+// Now slow down and do things right(tm).  Define
 //
 //    First(int, string) (first string, ok bool)
 //
-// and test with `go test -tags first`.
+// spelling first correctly this time, and test with `go test -tags first`.
 
 package slice
 
@@ -81,13 +73,13 @@ func TestAll(t *testing.T) {
 	}
 }
 
-func TestUnsafeFirst(t *testing.T) {
+func TestFrist(t *testing.T) {
 	for _, test := range allTests {
 		if len(test.out) == 0 {
 			continue
 		}
-		if res := UnsafeFirst(test.n, test.s); res != test.out[0] {
-			t.Fatalf("UnsafeFirst(%d, %s) = %s, want %s.",
+		if res := Frist(test.n, test.s); res != test.out[0] {
+			t.Fatalf("Frist(%d, %s) = %s, want %s.",
 				test.n, test.s, res, test.out[0])
 		}
 	}
diff --git a/exercises/tournament/tournament_test.go b/exercises/tournament/tournament_test.go
index 006c5a93..f60183b1 100644
--- a/exercises/tournament/tournament_test.go
+++ b/exercises/tournament/tournament_test.go
@@ -15,7 +15,7 @@ import (
 // Also define a testVersion with a value that matches
 // the targetTestVersion here.
 
-const targetTestVersion = 4
+const targetTestVersion = 3
 
 var _ func(io.Reader, io.Writer) error = Tally
 
@@ -140,7 +140,6 @@ func TestTallyError(t *testing.T) {
 		if err == nil {
 			t.Fatalf("Tally for input %q should have failed but didn't.", s)
 		}
-		var _ error = err
 	}
 }
 
diff --git a/exercises/triangle/triangle_test.go b/exercises/triangle/triangle_test.go
index 623eea8c..4532389a 100644
--- a/exercises/triangle/triangle_test.go
+++ b/exercises/triangle/triangle_test.go
@@ -5,7 +5,7 @@ import (
 	"testing"
 )
 
-const targetTestVersion = 3
+const targetTestVersion = 2
 
 type testCase struct {
 	want    Kind
@@ -26,8 +26,6 @@ var testData = []testCase{
 	{Sca, 5, 4, 2},    // descending order
 	{Sca, .4, .6, .3}, // small sides
 	{Sca, 1, 4, 3},    // a "triangle" that is just a line is still OK
-	{Sca, 5, 4, 6},    // 2a == b+c looks like equilateral, but isn't always.
-	{Sca, 6, 4, 5},    // 2a == b+c looks like equilateral, but isn't always.
 	{NaT, 0, 0, 0},    // zero length
 	{NaT, 3, 4, -5},   // negative length
 	{NaT, 1, 1, 3},    // fails triangle inequality
diff --git a/exercises/trinary/trinary_test.go b/exercises/trinary/trinary_test.go
index 0511539d..d13e117e 100644
--- a/exercises/trinary/trinary_test.go
+++ b/exercises/trinary/trinary_test.go
@@ -2,8 +2,6 @@ package trinary
 
 import "testing"
 
-const targetTestVersion = 1
-
 var tests = []struct {
 	arg  string
 	want int64
@@ -20,17 +18,10 @@ var tests = []struct {
 	{"2021110011022210012102010021220101220222", 0, false},
 }
 
-func TestTestVersion(t *testing.T) {
-	if testVersion != targetTestVersion {
-		t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
-	}
-}
-
 func TestParseTrinary(t *testing.T) {
 	for _, test := range tests {
 		switch res, err := ParseTrinary(test.arg); {
 		case err != nil:
-			var _ error = err
 			if test.ok {
 				t.Errorf("ParseTrinary(%q) returned error %q, Error not expected",
 					test.arg, err)
diff --git a/exercises/variable-length-quantity/variable_length_quantity_test.go b/exercises/variable-length-quantity/variable_length_quantity_test.go
new file mode 100644
index 00000000..66f7d22e
--- /dev/null
+++ b/exercises/variable-length-quantity/variable_length_quantity_test.go
@@ -0,0 +1,36 @@
+package variablelengthquantity
+
+import (
+	"bytes"
+	"testing"
+)
+
+func TestEncodeDecodeVarint(t *testing.T) {
+	testCases := []struct {
+		input  []byte
+		output uint32
+	}{
+		0: {[]byte{0x7F}, 127},
+		1: {[]byte{0x81, 0x00}, 128},
+		2: {[]byte{0xC0, 0x00}, 8192},
+		3: {[]byte{0xFF, 0x7F}, 16383},
+		4: {[]byte{0x81, 0x80, 0x00}, 16384},
+		5: {[]byte{0xFF, 0xFF, 0x7F}, 2097151},
+		6: {[]byte{0x81, 0x80, 0x80, 0x00}, 2097152},
+		7: {[]byte{0xC0, 0x80, 0x80, 0x00}, 134217728},
+		8: {[]byte{0xFF, 0xFF, 0xFF, 0x7F}, 268435455},
+
+		9:  {[]byte{0x82, 0x00}, 256},
+		10: {[]byte{0x81, 0x10}, 144},
+	}
+
+	for i, tc := range testCases {
+		t.Logf("test case %d - %#v\n", i, tc.input)
+		if o, _ := DecodeVarint(tc.input); o != tc.output {
+			t.Fatalf("expected %d\ngot\n%d\n", tc.output, o)
+		}
+		if encoded := EncodeVarint(tc.output); bytes.Compare(encoded, tc.input) != 0 {
+			t.Fatalf("%d - expected %#v\ngot\n%#v\n", tc.output, tc.input, encoded)
+		}
+	}
+}
diff --git a/exercises/word-search/word_search_test.go b/exercises/word-search/word_search_test.go
index 4fad037a..88e036da 100644
--- a/exercises/word-search/word_search_test.go
+++ b/exercises/word-search/word_search_test.go
@@ -10,7 +10,7 @@ import (
 // Also define a testVersion with a value that matches
 // the targetTestVersion here.
 
-const targetTestVersion = 3
+const targetTestVersion = 2
 
 var words = []string{
 	"clojure", "ecmascript", "elixir", "go", "java", "lisp",
@@ -51,7 +51,6 @@ func TestSolve(t *testing.T) {
 	}
 	actual, err := Solve(words, puzzle)
 	if err != nil {
-		var _ error = err
 		t.Fatalf("Didn't expect error but got %v", err)
 	}
 	if !reflect.DeepEqual(actual, positions) {