Use fmt.Errorf instead of errors.New
This commit is contained in:
@@ -16,7 +16,6 @@ limitations under the License.
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os/user"
|
"os/user"
|
||||||
@@ -121,7 +120,7 @@ func logConfig() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return errors.New(fmt.Sprintf("Unsupported platform: %v", runtime.GOOS))
|
return fmt.Errorf("Unsupported platform: %v", runtime.GOOS)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ limitations under the License.
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
@@ -45,7 +44,7 @@ func checkFS(path string) error {
|
|||||||
t := fsTypes[statfs.Type]
|
t := fsTypes[statfs.Type]
|
||||||
switch t {
|
switch t {
|
||||||
case "aufs", "overlayfs", "tmpfs":
|
case "aufs", "overlayfs", "tmpfs":
|
||||||
return errors.New(fmt.Sprintf("Error: %v uses unsupported filesystem type %v", path, t))
|
return fmt.Errorf("%v uses unsupported filesystem type: %v", path, t)
|
||||||
default:
|
default:
|
||||||
log.Printf("Detected %v has filesystem type '%v'", path, t)
|
log.Printf("Detected %v has filesystem type '%v'", path, t)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user