Skip to content

Commit 40c9cf7

Browse files
committed
style: remove if/else nesting
1 parent ecb723c commit 40c9cf7

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

discovery_server.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,19 +206,20 @@ func (d *DiscoveryServer) list() {
206206
d.outputError("list", "discovery already START_SYNCed, LIST not allowed")
207207
return
208208
}
209-
if ports, err := d.impl.List(); err != nil {
209+
ports, err := d.impl.List()
210+
if err != nil {
210211
d.outputError("list", "LIST error: "+err.Error())
211212
return
212-
} else {
213-
type listOutputJSON struct {
214-
EventType string `json:"eventType"`
215-
Ports []*Port `json:"ports"`
216-
}
217-
d.output(&listOutputJSON{
218-
EventType: "list",
219-
Ports: ports,
220-
})
221213
}
214+
215+
type listOutputJSON struct {
216+
EventType string `json:"eventType"`
217+
Ports []*Port `json:"ports"`
218+
}
219+
d.output(&listOutputJSON{
220+
EventType: "list",
221+
Ports: ports,
222+
})
222223
}
223224

224225
func (d *DiscoveryServer) startSync() {

0 commit comments

Comments
 (0)