mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
cleanup ps.go
The code is called in both cases so remove the duplicate one. Signed-off-by: Hushan Jia <hushan.jia@gmail.com>
This commit is contained in:
@@ -30,11 +30,12 @@ var psCommand = cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pids, err := container.Processes()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if context.String("format") == "json" {
|
if context.String("format") == "json" {
|
||||||
pids, err := container.Processes()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := json.NewEncoder(os.Stdout).Encode(pids); err != nil {
|
if err := json.NewEncoder(os.Stdout).Encode(pids); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -57,10 +58,6 @@ var psCommand = cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
pids, err := container.Processes()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fmt.Println(lines[0])
|
fmt.Println(lines[0])
|
||||||
for _, line := range lines[1:] {
|
for _, line := range lines[1:] {
|
||||||
if len(line) == 0 {
|
if len(line) == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user