diff --git a/pkg/cloudprovider/providers/mesos/mesos.go b/pkg/cloudprovider/providers/mesos/mesos.go index aec6c5cabb9..e5f187a9dff 100644 --- a/pkg/cloudprovider/providers/mesos/mesos.go +++ b/pkg/cloudprovider/providers/mesos/mesos.go @@ -169,7 +169,7 @@ func (c *MesosCloud) Master(clusterName string) (string, error) { return host, nil } } - return "", errors.New(fmt.Sprintf("The supplied cluster '%v' does not exist", clusterName)) + return "", fmt.Errorf("The supplied cluster '%v' does not exist", clusterName) } // ipAddress returns an IP address of the specified instance. diff --git a/pkg/volume/iscsi/iscsi_util.go b/pkg/volume/iscsi/iscsi_util.go index 70eed21fd4f..cfb71de46d0 100755 --- a/pkg/volume/iscsi/iscsi_util.go +++ b/pkg/volume/iscsi/iscsi_util.go @@ -125,7 +125,7 @@ func (util *ISCSIUtil) AttachDisk(b iscsiDiskMounter) error { if iscsiTransport == "" { glog.Errorf("iscsi: could not find transport name in iface %s", b.iface) - return errors.New(fmt.Sprintf("Could not parse iface file for %s", b.iface)) + return fmt.Errorf("Could not parse iface file for %s", b.iface) } else if iscsiTransport == "tcp" { devicePath = strings.Join([]string{"/dev/disk/by-path/ip", tp, "iscsi", b.iqn, "lun", b.lun}, "-") } else { diff --git a/test/e2e/kubectl.go b/test/e2e/kubectl.go index ea2f70cb30f..d895157e3a1 100644 --- a/test/e2e/kubectl.go +++ b/test/e2e/kubectl.go @@ -20,7 +20,6 @@ import ( "bytes" "context" "encoding/json" - "errors" "fmt" "io" "io/ioutil" @@ -1848,7 +1847,7 @@ func getUDData(jpgExpected string, ns string) func(clientset.Interface, string) if strings.Contains(data.Image, jpgExpected) { return nil } else { - return errors.New(fmt.Sprintf("data served up in container is inaccurate, %s didn't contain %s", data, jpgExpected)) + return fmt.Errorf("data served up in container is inaccurate, %s didn't contain %s", data, jpgExpected) } } } diff --git a/test/e2e_node/environment/conformance.go b/test/e2e_node/environment/conformance.go index 11e4d0065af..ce50a109f0b 100644 --- a/test/e2e_node/environment/conformance.go +++ b/test/e2e_node/environment/conformance.go @@ -82,7 +82,7 @@ func check(options ...string) []error { errs = appendNotNil(errs, kernel()) default: fmt.Printf("Unrecognized option %s", c) - errs = append(errs, errors.New(fmt.Sprintf("Unrecognized option %s", c))) + errs = append(errs, fmt.Errorf("Unrecognized option %s", c)) } } return errs