From f16e747205d72d8649c10b41f51dee5485d2acb8 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 10 Oct 2022 00:12:45 +0400 Subject: [PATCH] ProcessXMLEntry struct was made into an anonymous struct. --- processlist.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/processlist.go b/processlist.go index 8abc3de..fb12e1a 100644 --- a/processlist.go +++ b/processlist.go @@ -7,13 +7,6 @@ import ( // ProcessList is a map of processes' statuses. type ProcessList map[string]bool -// ProcessXMLEntry is a XML representation of a process stored in ProcessList. -type ProcessXMLEntry struct { - XMLName xml.Name - Name string `xml:"name,attr"` - IsUp bool `xml:",chardata"` -} - // MarshalXML implements Marshaler interface for a ProcessList. func (l *ProcessList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { if len(*l) == 0 { @@ -25,7 +18,11 @@ func (l *ProcessList) MarshalXML(e *xml.Encoder, start xml.StartElement) error { } for key, val := range *l { - e.Encode(ProcessXMLEntry{ + e.Encode(struct { + XMLName xml.Name + Name string `xml:"name,attr"` + IsUp bool `xml:",chardata"` + }{ XMLName: xml.Name{Local: "Process"}, Name: key, IsUp: val})