Skip to content

Commit c099734

Browse files
committed
Replace fmt.Errorf with errors.New
If the returning error message doesnot require formatting, use errors.New(). the error message should not be capitalized, replace it with smaller case
1 parent 8963fb3 commit c099734

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/hostpath/hostpath.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package hostpath
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"io"
2223
"os"
@@ -93,15 +94,15 @@ func init() {
9394

9495
func NewHostPathDriver(driverName, nodeID, endpoint string, ephemeral bool, maxVolumesPerNode int64, version string) (*hostPath, error) {
9596
if driverName == "" {
96-
return nil, fmt.Errorf("No driver name provided")
97+
return nil, errors.New("no driver name provided")
9798
}
9899

99100
if nodeID == "" {
100-
return nil, fmt.Errorf("No node id provided")
101+
return nil, errors.New("no node id provided")
101102
}
102103

103104
if endpoint == "" {
104-
return nil, fmt.Errorf("No driver endpoint provided")
105+
return nil, errors.New("no driver endpoint provided")
105106
}
106107
if version != "" {
107108
vendorVersion = version

0 commit comments

Comments
 (0)