mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Merge pull request #8378 from jwhonce/issues/8366
Swap out json-iterator for golang default
This commit is contained in:
@ -2,6 +2,7 @@ package inspect
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json" // due to a bug in json-iterator it cannot be used here
|
||||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
@ -36,9 +37,6 @@ const (
|
||||
VolumeType = "volume"
|
||||
)
|
||||
|
||||
// Pull in configured json library
|
||||
var json = registry.JSONLibrary()
|
||||
|
||||
// AddInspectFlagSet takes a command and adds the inspect flags and returns an
|
||||
// InspectOptions object.
|
||||
func AddInspectFlagSet(cmd *cobra.Command) *entities.InspectOptions {
|
||||
@ -238,9 +236,12 @@ func (i *inspector) inspect(namesOrIDs []string) error {
|
||||
}
|
||||
|
||||
func printJSON(data []interface{}) error {
|
||||
enc := json.NewEncoder(os.Stdout)
|
||||
enc.SetIndent("", " ")
|
||||
return enc.Encode(data)
|
||||
buf, err := json.MarshalIndent(data, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = fmt.Println(string(buf))
|
||||
return err
|
||||
}
|
||||
|
||||
func printTmpl(typ, row string, data []interface{}) error {
|
||||
|
Reference in New Issue
Block a user