diff --git a/session/module.go b/session/module.go index f7ec2064..dbdf6d1b 100644 --- a/session/module.go +++ b/session/module.go @@ -39,7 +39,7 @@ type moduleJSON struct { } func (mm ModuleList) MarshalJSON() ([]byte, error) { - mods := make(map[string]moduleJSON) + mods := []moduleJSON{} for _, m := range mm { mJSON := moduleJSON{ Name: m.Name(), @@ -50,7 +50,7 @@ func (mm ModuleList) MarshalJSON() ([]byte, error) { Running: m.Running(), State: m.Extra(), } - mods[m.Name()] = mJSON + mods = append(mods, mJSON) } return json.Marshal(mods) }