From e5c95b04760f7d5ffd457bb5dde753f413243049 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Thu, 1 Dec 2022 23:24:25 +0100 Subject: [PATCH] register fix --- consul/discovery.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/consul/discovery.go b/consul/discovery.go index c043579..2f60d24 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -23,16 +23,16 @@ type Service struct { var ErrServiceUnavailable = fmt.Errorf("Service is unavailable") -func NewService(serverAddr, appID, appName, ip, domain string, appPort int) (*Service, error) { +func NewService(servAddr, id, appName, ip, domain string, appPort int) (*Service, error) { s := new(Service) - s.AppID = appID + s.AppID = id s.Name = strings.Replace(appName, "-", "", -1) s.Address = domain s.IP = ip s.Port = appPort s.TTL = time.Second * 15 - client, err := consul.NewClient(newClientConfig(serverAddr)) + client, err := consul.NewClient(newClientConfig(servAddr)) if err != nil { return nil, err }