fix(inmem): ID comparation and error message for invalid IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>pull/10616/head
parent
6ca8ab5139
commit
c0d0c0196c
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue