diff --git a/app/origin_node.go b/app/origin_node.go index 2cfa1b7700..cc7b85b10d 100644 --- a/app/origin_node.go +++ b/app/origin_node.go @@ -33,13 +33,13 @@ func originNodeForProcess(node report.NodeMetadata) OriginNode { {Key: "PID", ValueMajor: node["pid"], ValueMinor: ""}, {Key: "Process name", ValueMajor: node["name"], ValueMinor: ""}, } - for key, human := range map[string]string{ - "docker_id": "Container ID", - "docker_name": "Container name", - "cgroup": "cgroup", + for _, tuple := range []struct{ key, human string }{ + {"docker_id", "Container ID"}, + {"docker_name", "Container name"}, + {"cgroup", "cgroup"}, } { - if val, ok := node[key]; ok { - rows = append(rows, report.Row{Key: human, ValueMajor: val, ValueMinor: ""}) + if val, ok := node[tuple.key]; ok { + rows = append(rows, report.Row{Key: tuple.human, ValueMajor: val, ValueMinor: ""}) } } return OriginNode{