fix(inmem): ID comparation and error message for invalid IDs

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
pull/10616/head
Leonardo Di Donato 2018-09-25 10:52:15 +02:00 committed by Chris Goller
parent 6ca8ab5139
commit c0d0c0196c
2 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,6 @@
package inmem
import (
"bytes"
"context"
"fmt"
@ -29,7 +28,7 @@ func (s *Service) FindViewByID(ctx context.Context, id platform.ID) (*platform.V
func filterViewFn(filter platform.ViewFilter) func(d *platform.View) bool {
if filter.ID != nil {
return func(d *platform.View) bool {
return bytes.Equal(d.ID, *filter.ID)
return d.ID == *filter.ID
}
}

View File

@ -443,7 +443,7 @@ func UpdateTarget(
url: "changed",
},
wants: wants{
err: errors.New("update scraper: id is empty"),
err: errors.New("update scraper: id is invalid"),
},
},
{