use marshalindent instead of marshal
Signed-off-by: Xu Yang <xyang@ciq.com>
This commit is contained in:
@@ -114,7 +114,7 @@ func NodeList(nodeGet *wwapiv1.GetNodeList) (nodeList wwapiv1.NodeList, err erro
|
||||
|
||||
var buf []byte
|
||||
if nodeGet.Type == wwapiv1.GetNodeList_JSON {
|
||||
buf, _ = json.Marshal(nodeResp)
|
||||
buf, _ = json.MarshalIndent(nodeResp, "", " ")
|
||||
}
|
||||
if nodeGet.Type == wwapiv1.GetNodeList_YAML {
|
||||
buf, _ = yaml.Marshal(nodeResp)
|
||||
|
||||
@@ -55,7 +55,7 @@ func ProfileList(ShowOpt *wwapiv1.GetProfileList) (profileList wwapiv1.ProfileLi
|
||||
profileMap[profile.Id.Get()] = profile
|
||||
}
|
||||
|
||||
buf, _ := json.Marshal(profileMap)
|
||||
buf, _ := json.MarshalIndent(profileMap, "", " ")
|
||||
profileList.Output = append(profileList.Output, string(buf))
|
||||
} else {
|
||||
profileList.Output = append(profileList.Output,
|
||||
|
||||
Reference in New Issue
Block a user