From 39bac0dbefacbe79ad519de0ab7a27c4e39e6db7 Mon Sep 17 00:00:00 2001 From: Zechun Chen Date: Wed, 15 Feb 2023 14:30:36 +0800 Subject: [PATCH] error strings should not be capitalized Signed-off-by: Zechun Chen --- cmd/ctr/commands/sandboxes/sandboxes.go | 4 ++-- integration/remote/utils.go | 14 +++++++------- pkg/truncindex/truncindex.go | 2 +- services/introspection/service.go | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/ctr/commands/sandboxes/sandboxes.go b/cmd/ctr/commands/sandboxes/sandboxes.go index 1395fa0d9..8d3f051b1 100644 --- a/cmd/ctr/commands/sandboxes/sandboxes.go +++ b/cmd/ctr/commands/sandboxes/sandboxes.go @@ -65,12 +65,12 @@ var runCommand = cli.Command{ spec, err := os.ReadFile(context.Args().First()) if err != nil { - return fmt.Errorf("Failed to read sandbox config: %w", err) + return fmt.Errorf("failed to read sandbox config: %w", err) } ociSpec := oci.Spec{} if err = json.Unmarshal(spec, &ociSpec); err != nil { - return fmt.Errorf("Failed to parse sandbox config: %w", err) + return fmt.Errorf("failed to parse sandbox config: %w", err) } client, ctx, cancel, err := commands.NewClient(context) diff --git a/integration/remote/utils.go b/integration/remote/utils.go index 4ed583ba8..094e6bb93 100644 --- a/integration/remote/utils.go +++ b/integration/remote/utils.go @@ -57,16 +57,16 @@ func getContextWithCancel() (context.Context, context.CancelFunc) { // verifySandboxStatus verified whether all required fields are set in PodSandboxStatus. func verifySandboxStatus(status *runtimeapi.PodSandboxStatus) error { if status.Id == "" { - return fmt.Errorf("Id is not set") + return fmt.Errorf("id is not set") } if status.Metadata == nil { - return fmt.Errorf("Metadata is not set") + return fmt.Errorf("metadata is not set") } metadata := status.Metadata if metadata.Name == "" || metadata.Namespace == "" || metadata.Uid == "" { - return fmt.Errorf("Name, Namespace or Uid is not in metadata %q", metadata) + return fmt.Errorf("name, namespace or uid is not in metadata %q", metadata) } if status.CreatedAt == 0 { @@ -79,16 +79,16 @@ func verifySandboxStatus(status *runtimeapi.PodSandboxStatus) error { // verifyContainerStatus verified whether all required fields are set in ContainerStatus. func verifyContainerStatus(status *runtimeapi.ContainerStatus) error { if status.Id == "" { - return fmt.Errorf("Id is not set") + return fmt.Errorf("id is not set") } if status.Metadata == nil { - return fmt.Errorf("Metadata is not set") + return fmt.Errorf("metadata is not set") } metadata := status.Metadata if metadata.Name == "" { - return fmt.Errorf("Name is not in metadata %q", metadata) + return fmt.Errorf("name is not in metadata %q", metadata) } if status.CreatedAt == 0 { @@ -96,7 +96,7 @@ func verifyContainerStatus(status *runtimeapi.ContainerStatus) error { } if status.Image == nil || status.Image.Image == "" { - return fmt.Errorf("Image is not set") + return fmt.Errorf("image is not set") } if status.ImageRef == "" { diff --git a/pkg/truncindex/truncindex.go b/pkg/truncindex/truncindex.go index 9e5344741..3eeaa2268 100644 --- a/pkg/truncindex/truncindex.go +++ b/pkg/truncindex/truncindex.go @@ -32,7 +32,7 @@ import ( var ( // ErrEmptyPrefix is an error returned if the prefix was empty. - ErrEmptyPrefix = errors.New("Prefix can't be empty") + ErrEmptyPrefix = errors.New("prefix can't be empty") // ErrIllegalChar is returned when a space is in the ID ErrIllegalChar = errors.New("illegal character: ' '") diff --git a/services/introspection/service.go b/services/introspection/service.go index cd5ae964b..60013b52c 100644 --- a/services/introspection/service.go +++ b/services/introspection/service.go @@ -49,7 +49,7 @@ func init() { localClient, ok := i.(*Local) if !ok { - return nil, errors.New("Could not create a local client for introspection service") + return nil, errors.New("could not create a local client for introspection service") } localClient.UpdateLocal(ic.Root)