feat: Errorf usage

Signed-off-by: haoyun <yun.hao@daocloud.io>
This commit is contained in:
haoyun
2021-12-13 14:31:53 +08:00
parent a04656c1dd
commit c0d07094be
30 changed files with 80 additions and 80 deletions

View File

@@ -63,7 +63,7 @@ func (m *Mount) Mount(target string) (err error) {
flags, data, losetup := parseMountOptions(options)
if len(data) > pagesize {
return errors.Errorf("mount options is too long")
return errors.New("mount options is too long")
}
// propagation types.

View File

@@ -43,7 +43,7 @@ func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) erro
// For details, please refer to #1868 #1785.
defer func() {
if uerr = os.Remove(root); uerr != nil {
log.G(ctx).WithError(uerr).WithField("dir", root).Errorf("failed to remove mount temp dir")
log.G(ctx).WithError(uerr).WithField("dir", root).Error("failed to remove mount temp dir")
}
}()