[Fix] first try to fix the build error
This commit is contained in:
parent
0fef88f07e
commit
c9e944d9f3
|
@ -33,7 +33,7 @@ func ProductExists(id int64) (bool, error) {
|
|||
}
|
||||
|
||||
url := fmt.Sprintf(ProductURL, id)
|
||||
log.Log.WithField("url", url).Info("exists product?")
|
||||
log.Log.WithField("url", url).Info("does the product exist?")
|
||||
res, err := http.Get(url)
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
|
|
@ -20,19 +20,19 @@ func TestProductExists(t *testing.T) {
|
|||
}
|
||||
go srv.ListenAndServe()
|
||||
|
||||
ok, err := ProductExists(3)
|
||||
ok, err := ProductExists(6)
|
||||
assert.True(ok)
|
||||
assert.NoError(err)
|
||||
|
||||
// test cache
|
||||
ok, err = ProductExists(3)
|
||||
ok, err = ProductExists(6)
|
||||
assert.True(ok)
|
||||
assert.NoError(err)
|
||||
|
||||
productExistCache = make(map[int64]boolMicroServiceCache)
|
||||
ProductURL = "http://localhost:8081/api-test/product/%d/"
|
||||
|
||||
ok, err = ProductExists(3)
|
||||
ok, err = ProductExists(6)
|
||||
assert.Error(err)
|
||||
|
||||
srv.Close()
|
||||
|
|
Reference in New Issue