kezhenxu94 commented on a change in pull request #15: [Feature] Support
instance search command
URL: https://github.com/apache/skywalking-cli/pull/15#discussion_r349870191
##########
File path: display/json/json.go
##########
@@ -24,7 +24,12 @@ import (
func Display(object interface{}) error {
if bytes, e := json.Marshal(object); e == nil {
- fmt.Printf("%v\n", string(bytes))
+ content := string(bytes)
+ if content == "null" {
+ fmt.Print("[]\n")
Review comment:
I think it's ok to output `null` in JSON format, because `null` is valid in
JSON, and the `object` is not necessarily always `array`;
the `table` style indeed needs to be fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services