Use error.New () directly to output the error message
Signed-off-by: fate-grand-order <chenjg@harmonycloud.cn>
This commit is contained in:
@@ -2,7 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
gocontext "context"
|
||||
"fmt"
|
||||
"errors"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/docker/containerd/api/execution"
|
||||
@@ -20,7 +20,7 @@ var inspectCommand = cli.Command{
|
||||
}
|
||||
id := context.Args().First()
|
||||
if id == "" {
|
||||
return fmt.Errorf("container id must be provided")
|
||||
return errors.New("container id must be provided")
|
||||
}
|
||||
getResponse, err := executionService.GetContainer(gocontext.Background(),
|
||||
&execution.GetContainerRequest{ID: id})
|
||||
|
||||
Reference in New Issue
Block a user