Run go vet

Bugs found.
This commit is contained in:
kortschak 2014-08-28 12:22:37 +09:30
parent 8118c8d3cc
commit bf6412b55d
12 changed files with 28 additions and 14 deletions

View file

@ -68,7 +68,7 @@ func (q *Query) buildIteratorTreeInternal(query interface{}, path Path) (it grap
// Damn you, Javascript, and your lack of integer values.
if math.Floor(t) == t {
// Treat it like an integer.
it = q.buildFixed(fmt.Sprintf("%d", t))
it = q.buildFixed(fmt.Sprintf("%0.f", t))
} else {
it = q.buildFixed(fmt.Sprintf("%f", t))
}

View file

@ -186,7 +186,7 @@ func TestMQL(t *testing.T) {
if !reflect.DeepEqual(got, expect) {
b, err := json.MarshalIndent(got, "", " ")
if err != nil {
t.Fatalf("unexpected JSON marshal error", err)
t.Fatalf("unexpected JSON marshal error: %v", err)
}
t.Errorf("Failed to %s, got: %s expected: %s", test.message, b, test.expect)
}

View file

@ -269,5 +269,4 @@ func buildIteratorTree(tree *peg.ExpressionTree, qs graph.QuadStore) graph.Itera
default:
return &iterator.Null{}
}
panic("Not reached")
}

View file

@ -89,7 +89,7 @@ func TestTreeConstraintParse(t *testing.T) {
"($a (:is :good))))"
it := BuildIteratorTreeForQuery(qs, query)
if it.Type() != graph.And {
t.Error("Odd iterator tree. Got: %s", it.DebugString(0))
t.Errorf("Odd iterator tree. Got: %s", it.DebugString(0))
}
if !graph.Next(it) {
t.Error("Got no results")
@ -137,7 +137,7 @@ func TestMultipleConstraintParse(t *testing.T) {
)`
it := BuildIteratorTreeForQuery(qs, query)
if it.Type() != graph.And {
t.Error("Odd iterator tree. Got: %s", it.DebugString(0))
t.Errorf("Odd iterator tree. Got: %s", it.DebugString(0))
}
if !graph.Next(it) {
t.Error("Got no results")