fixup multiple client handling
Some checks failed
lint / lint (pull_request) Failing after 1m29s
pr / test (pull_request) Failing after 2m35s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-11-13 08:19:44 +03:00
parent 0be09c8b3e
commit 80a2db264e
2 changed files with 79 additions and 11 deletions

View File

@@ -17,6 +17,21 @@ import (
"go.unistack.org/micro/v3/tracer"
)
func TestClient(t *testing.T) {
c1 := client.NewClient(client.Name("test1"))
c2 := client.NewClient(client.Name("test2"))
svc := NewService(Client(c1, c2))
if err := svc.Init(); err != nil {
t.Fatal(err)
}
x1 := svc.Client("test2")
if x1.Name() != "test2" {
t.Fatal("invalid client")
}
}
type testItem struct {
name string
}