tools: Remove error return value from query.Parse()

It was always nil

Bug: dawn:1342
Change-Id: I7bc623bba1cbc65e6b91dee7af9bc6b096174605
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85803
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Ben Clayton 2022-04-05 17:08:25 +00:00 committed by Dawn LUCI CQ
parent 7ee6bf3dda
commit 3a279a84e7
2 changed files with 6 additions and 16 deletions

View File

@ -95,7 +95,7 @@ const (
)
// Parse parses a query string
func Parse(s string) (Query, error) {
func Parse(s string) Query {
parts := strings.Split(s, TargetDelimiter)
q := Query{}
switch len(parts) {
@ -111,7 +111,7 @@ func Parse(s string) (Query, error) {
case 1:
q.Suite = parts[0]
}
return q, nil
return q
}
// AppendFiles returns a new query with the strings appended to the 'files'

View File

@ -23,13 +23,7 @@ import (
"github.com/google/go-cmp/cmp"
)
func Q(name string) query.Query {
q, err := query.Parse(name)
if err != nil {
panic(err)
}
return q
}
var Q = query.Parse
func TestTargetFormat(t *testing.T) {
type Test struct {
@ -590,11 +584,7 @@ func TestParsePrint(t *testing.T) {
},
},
} {
parsed, err := query.Parse(test.in)
if err != nil {
t.Errorf("query.Parse('%v') returned %v", test.in, err)
continue
}
parsed := query.Parse(test.in)
if diff := cmp.Diff(test.expect, parsed); diff != "" {
t.Errorf("query.Parse('%v')\n%v", test.in, diff)
}