From ad8088f1c1627cf39006bd930901e473e83a18e4 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Sun, 14 Feb 2021 00:28:49 +0100 Subject: [PATCH] bugfix, if/else --- main.go | 69 +++++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/main.go b/main.go index 54a35d8..712cbd6 100644 --- a/main.go +++ b/main.go @@ -255,7 +255,6 @@ func processAPIs() { nodes = append(nodes, mvNodes...) links = append(links, mvLinks...) } - // assemble final struct o := output{ Timestamp: time.Now().Format(iso8601), @@ -547,41 +546,39 @@ func addmvDevices(d mvDevices) ([]node, []link) { Model: mvNode.Model, }) } else { - if mvNode.Location.Latitude == 0 { - nodes = append(nodes, node{ - Firstseen: mvNode.Firstseen, - Lastseen: mvNode.Lastseen, - IsOnline: mvNode.IsOnline, - IsGateway: mvNode.IsGateway, - Clients: mvNode.Clients, - ClientsWifi24: mvNode.ClientsWifi24, - ClientsWifi5: mvNode.ClientsWifi5, - ClientsOther: mvNode.ClientsOther, - RootFSUsage: int(mvNode.RootfsUsage), - LoadAVG: mvNode.Loadavg, - MemoryUsage: mvNode.MemoryUsage, - Uptime: mvNode.Uptime, - GatewayNexthop: mvNode.GatewayNexthop, - Gateway: mvNode.Gateway, - Location: &mvNode.Location, - NodeID: mvNode.NodeID, - MAC: mvNode.Mac, - Adresses: mvNode.Addresses, - Domain: mvNode.Domain, - Hostname: mvNode.Hostname, - Owner: mvNode.Owner, - Firmware: firmware{ - Base: mvNode.Firmware.Base, - Release: mvNode.Firmware.Release, - }, - Autoupdater: autoupdater{ - Enabled: mvNode.Autoupdater.Enabled, - Branch: mvNode.Autoupdater.Branch, - }, - NProc: mvNode.Nproc, - Model: mvNode.Model, - }) - } + nodes = append(nodes, node{ + Firstseen: mvNode.Firstseen, + Lastseen: mvNode.Lastseen, + IsOnline: mvNode.IsOnline, + IsGateway: mvNode.IsGateway, + Clients: mvNode.Clients, + ClientsWifi24: mvNode.ClientsWifi24, + ClientsWifi5: mvNode.ClientsWifi5, + ClientsOther: mvNode.ClientsOther, + RootFSUsage: int(mvNode.RootfsUsage), + LoadAVG: mvNode.Loadavg, + MemoryUsage: mvNode.MemoryUsage, + Uptime: mvNode.Uptime, + GatewayNexthop: mvNode.GatewayNexthop, + Gateway: mvNode.Gateway, + Location: &mvNode.Location, + NodeID: mvNode.NodeID, + MAC: mvNode.Mac, + Adresses: mvNode.Addresses, + Domain: mvNode.Domain, + Hostname: mvNode.Hostname, + Owner: mvNode.Owner, + Firmware: firmware{ + Base: mvNode.Firmware.Base, + Release: mvNode.Firmware.Release, + }, + Autoupdater: autoupdater{ + Enabled: mvNode.Autoupdater.Enabled, + Branch: mvNode.Autoupdater.Branch, + }, + NProc: mvNode.Nproc, + Model: mvNode.Model, + }) } } for i := range d.Links {