本文整理匯總了Golang中github.com/flynn/flynn/discoverd/server.IsNotFound函數的典型用法代碼示例。如果您正苦於以下問題:Golang IsNotFound函數的具體用法?Golang IsNotFound怎麽用?Golang IsNotFound使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了IsNotFound函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestStore_RemoveInstance_ErrNotFound
// Ensure the store returns an error when removing an instance from a non-existent service.
func TestStore_RemoveInstance_ErrNotFound(t *testing.T) {
s := MustOpenStore()
defer s.Close()
if err := s.RemoveInstance("no_such_service", "inst0"); !server.IsNotFound(err) {
t.Fatalf("unexpected error: %s", err)
}
}
示例2: TestStore_AddInstance_ErrNotFound
// Ensure the store can add instances to a service.
func TestStore_AddInstance_ErrNotFound(t *testing.T) {
s := MustOpenStore()
defer s.Close()
if err := s.AddInstance("no_such_service", &discoverd.Instance{ID: "inst0"}); !server.IsNotFound(err) {
t.Fatalf("unexpected error: %s", err)
}
}
示例3: TestStore_SetServiceMeta_ErrNotFound
// Ensure the store returns an error when setting metadata for a non-existent service.
func TestStore_SetServiceMeta_ErrNotFound(t *testing.T) {
s := MustOpenStore()
defer s.Close()
if err := s.SetServiceMeta("service0", &discoverd.ServiceMeta{Data: []byte(`"foo"`), Index: 0}); !server.IsNotFound(err) {
t.Fatalf("unexpected error: %s", err)
}
}