Skip to content

Commit

Permalink
prevent nil wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Jan 20, 2020
1 parent 8e8b4ba commit 19ef106
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions search/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ func TestElasticSort(t *testing.T) {
}

resolver := func(key string) assets.Field {
return registry[key]
field, found := registry[key]
if !found {
return nil
}
return field
}

for _, tc := range tcs {
Expand Down Expand Up @@ -100,7 +104,11 @@ func TestElasticQuery(t *testing.T) {
ny, _ := time.LoadLocation("America/New_York")

resolver := func(key string) assets.Field {
return registry[key]
field, found := registry[key]
if !found {
return nil
}
return field
}

for _, tc := range tcs {
Expand Down

0 comments on commit 19ef106

Please sign in to comment.