mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
Replace formatted errors when unneeded
Signed-off-by: John Hwang <John.F.Hwang@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@ package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -52,7 +53,7 @@ var psCommand = cli.Command{
|
||||
case "json":
|
||||
return json.NewEncoder(os.Stdout).Encode(pids)
|
||||
default:
|
||||
return fmt.Errorf("invalid format option")
|
||||
return errors.New("invalid format option")
|
||||
}
|
||||
|
||||
// [1:] is to remove command name, ex:
|
||||
@@ -109,5 +110,5 @@ func getPidIndex(title string) (int, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return pidIndex, fmt.Errorf("couldn't find PID field in ps output")
|
||||
return pidIndex, errors.New("couldn't find PID field in ps output")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user