Skip to content

Commit dc746ad

Browse files
committed
fix: add the endpoints to registry.ServiceInstance
1 parent 71086f9 commit dc746ad

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

gmicro/app/app.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ func (a *App) Stop() error {
109109
// buildInstance create the service instance info
110110
func (a *App) buildInstance() (*registry.ServiceInstance, error) {
111111
// build the service instance
112-
i := &registry.ServiceInstance{
113-
ID: a.opts.id,
114-
Name: a.opts.name,
115-
}
112+
116113
endpoints := make([]string, 0, len(a.opts.endpoints)+1)
117114
for _, ep := range a.opts.endpoints {
118115
if ep != nil {
@@ -131,5 +128,9 @@ func (a *App) buildInstance() (*registry.ServiceInstance, error) {
131128
//if a.opts.registrar == nil {
132129
// a.opts.registrar = a.opts.defaultRegistrar()
133130
//}
134-
return i, nil
131+
return &registry.ServiceInstance{
132+
ID: a.opts.id,
133+
Name: a.opts.name,
134+
Endpoints: endpoints,
135+
}, nil
135136
}

0 commit comments

Comments
 (0)