From 38160d9f061454c6f596a8c9b48a9a1009ed673f Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Wed, 17 Jul 2024 10:52:40 +0900 Subject: [PATCH] fix: replace the word `temporal` with `temporary` --- pkg/cosign/verify.go | 6 +++--- pkg/download/file.go | 2 +- pkg/installpackage/aqua.go | 2 +- pkg/installpackage/checksum.go | 8 ++++---- pkg/installpackage/download.go | 2 +- pkg/installpackage/verify_cosign.go | 2 +- pkg/installpackage/verify_slsa.go | 2 +- pkg/minisign/verifier.go | 2 +- pkg/slsa/verifier.go | 4 ++-- pkg/unarchive/dmg.go | 8 ++++---- pkg/unarchive/pkg.go | 2 +- pkg/unarchive/unarchiver.go | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pkg/cosign/verify.go b/pkg/cosign/verify.go index 2059efcf6..58bc93b61 100644 --- a/pkg/cosign/verify.go +++ b/pkg/cosign/verify.go @@ -64,7 +64,7 @@ func (v *Verifier) Verify(ctx context.Context, logE *logrus.Entry, rt *runtime.R if cos.Signature != nil { sigFile, err := afero.TempFile(v.fs, "", "") if err != nil { - return fmt.Errorf("create a temporal file: %w", err) + return fmt.Errorf("create a temporary file: %w", err) } defer v.fs.Remove(sigFile.Name()) //nolint:errcheck @@ -81,7 +81,7 @@ func (v *Verifier) Verify(ctx context.Context, logE *logrus.Entry, rt *runtime.R if cos.Key != nil { keyFile, err := afero.TempFile(v.fs, "", "") if err != nil { - return fmt.Errorf("create a temporal file: %w", err) + return fmt.Errorf("create a temporary file: %w", err) } defer v.fs.Remove(keyFile.Name()) //nolint:errcheck @@ -99,7 +99,7 @@ func (v *Verifier) Verify(ctx context.Context, logE *logrus.Entry, rt *runtime.R if cos.Certificate != nil { certFile, err := afero.TempFile(v.fs, "", "") if err != nil { - return fmt.Errorf("create a temporal file: %w", err) + return fmt.Errorf("create a temporary file: %w", err) } defer v.fs.Remove(certFile.Name()) //nolint:errcheck diff --git a/pkg/download/file.go b/pkg/download/file.go index c3d7c64ce..0dc9c5f3d 100644 --- a/pkg/download/file.go +++ b/pkg/download/file.go @@ -78,7 +78,7 @@ func (f *DownloadedFile) Wrap(w io.Writer) io.Writer { func (f *DownloadedFile) copy() error { tmp, err := afero.TempFile(f.fs, "", "") if err != nil { - return fmt.Errorf("create a temporal file: %w", err) + return fmt.Errorf("create a temporary file: %w", err) } f.path = tmp.Name() var w io.Writer = tmp diff --git a/pkg/installpackage/aqua.go b/pkg/installpackage/aqua.go index c3e4b13a6..2e0c020ca 100644 --- a/pkg/installpackage/aqua.go +++ b/pkg/installpackage/aqua.go @@ -159,7 +159,7 @@ func (is *Installer) copyAquaOnWindows(exePath string) error { // > The system cannot move the file to a different disk drive tempDir := filepath.Join(is.rootDir, "temp") if err := osfile.MkdirAll(is.fs, tempDir); err != nil { - return fmt.Errorf("create a temporal directory: %w", err) + return fmt.Errorf("create a temporary directory: %w", err) } if err := is.fs.Rename(dest, filepath.Join(tempDir, "aqua.exe")); err != nil { return fmt.Errorf("rename aqua.exe to update: %w", err) diff --git a/pkg/installpackage/checksum.go b/pkg/installpackage/checksum.go index 6b7601e15..23db681e6 100644 --- a/pkg/installpackage/checksum.go +++ b/pkg/installpackage/checksum.go @@ -31,12 +31,12 @@ func (is *Installer) dlAndExtractChecksum(ctx context.Context, logE *logrus.Entr if cos := pkg.PackageInfo.Checksum.GetCosign(); cos.GetEnabled() && !is.cosignDisabled { f, err := afero.TempFile(is.fs, "", "") if err != nil { - return "", fmt.Errorf("create a temporal file: %w", err) + return "", fmt.Errorf("create a temporary file: %w", err) } defer f.Close() defer is.fs.Remove(f.Name()) //nolint:errcheck if _, err := f.Write(b); err != nil { - return "", fmt.Errorf("write a checksum to a temporal file: %w", err) + return "", fmt.Errorf("write a checksum to a temporary file: %w", err) } art := pkg.TemplateArtifact(is.runtime, assetName) logE.Info("verify a checksum file with Cosign") @@ -72,7 +72,7 @@ func (is *Installer) verifyChecksumWrap(ctx context.Context, logE *logrus.Entry, ppkg := param.Package tempFilePath, err := bodyFile.Path() if err != nil { - return fmt.Errorf("get a temporal file path: %w", err) + return fmt.Errorf("get a temporary file path: %w", err) } paramVerifyChecksum := &ParamVerifyChecksum{ Checksum: param.Checksum, @@ -113,7 +113,7 @@ func (is *Installer) verifyChecksum(ctx context.Context, logE *logrus.Entry, par checksumID := param.ChecksumID tempFilePath := param.TempFilePath - // Download an asset in a temporal directory + // Download an asset in a temporary directory // Calculate the checksum of download asset // Download a checksum file // Extract the checksum from the checksum file diff --git a/pkg/installpackage/download.go b/pkg/installpackage/download.go index ccf794b74..555d18bc6 100644 --- a/pkg/installpackage/download.go +++ b/pkg/installpackage/download.go @@ -88,7 +88,7 @@ func (is *Installer) download(ctx context.Context, logE *logrus.Entry, param *Do bodyFile := download.NewDownloadedFile(is.fs, body, pb) defer func() { if err := bodyFile.Remove(); err != nil { - logE.WithError(err).Warn("remove a temporal file") + logE.WithError(err).Warn("remove a temporary file") } }() diff --git a/pkg/installpackage/verify_cosign.go b/pkg/installpackage/verify_cosign.go index e6a591760..549126bb8 100644 --- a/pkg/installpackage/verify_cosign.go +++ b/pkg/installpackage/verify_cosign.go @@ -29,7 +29,7 @@ func (is *Installer) verifyWithCosign(ctx context.Context, logE *logrus.Entry, b } tempFilePath, err := bodyFile.Path() if err != nil { - return fmt.Errorf("get a temporal file path: %w", err) + return fmt.Errorf("get a temporary file path: %w", err) } if err := is.cosign.Verify(ctx, logE, is.runtime, &download.File{ RepoOwner: ppkg.PackageInfo.RepoOwner, diff --git a/pkg/installpackage/verify_slsa.go b/pkg/installpackage/verify_slsa.go index f875c0934..ba3d81c8d 100644 --- a/pkg/installpackage/verify_slsa.go +++ b/pkg/installpackage/verify_slsa.go @@ -27,7 +27,7 @@ func (is *Installer) verifyWithSLSA(ctx context.Context, logE *logrus.Entry, bod } tempFilePath, err := bodyFile.Path() if err != nil { - return fmt.Errorf("get a temporal file path: %w", err) + return fmt.Errorf("get a temporary file path: %w", err) } if err := is.slsaVerifier.Verify(ctx, logE, is.runtime, sp, art, &download.File{ RepoOwner: ppkg.PackageInfo.RepoOwner, diff --git a/pkg/minisign/verifier.go b/pkg/minisign/verifier.go index d2ed78fad..3a0a0e4c2 100644 --- a/pkg/minisign/verifier.go +++ b/pkg/minisign/verifier.go @@ -45,7 +45,7 @@ func (v *Verifier) Verify(ctx context.Context, logE *logrus.Entry, rt *runtime.R signatureFile, err := afero.TempFile(v.fs, "", "") if err != nil { - return fmt.Errorf("create a temporal file: %w", err) + return fmt.Errorf("create a temporary file: %w", err) } defer signatureFile.Close() defer v.fs.Remove(signatureFile.Name()) //nolint:errcheck diff --git a/pkg/slsa/verifier.go b/pkg/slsa/verifier.go index 9ef5b6194..eddc3caed 100644 --- a/pkg/slsa/verifier.go +++ b/pkg/slsa/verifier.go @@ -48,12 +48,12 @@ func (v *Verifier) Verify(ctx context.Context, logE *logrus.Entry, rt *runtime.R provenanceFile, err := afero.TempFile(v.fs, "", "") if err != nil { - return fmt.Errorf("create a temporal file: %w", err) + return fmt.Errorf("create a temporary file: %w", err) } defer provenanceFile.Close() defer v.fs.Remove(provenanceFile.Name()) //nolint:errcheck if _, err := io.Copy(provenanceFile, rc); err != nil { - return fmt.Errorf("copy a provenance to a temporal file: %w", err) + return fmt.Errorf("copy a provenance to a temporary file: %w", err) } return v.exe.Verify(ctx, logE, param, provenanceFile.Name()) //nolint:wrapcheck diff --git a/pkg/unarchive/dmg.go b/pkg/unarchive/dmg.go index 22f1781de..8e9a2014c 100644 --- a/pkg/unarchive/dmg.go +++ b/pkg/unarchive/dmg.go @@ -30,17 +30,17 @@ func (u *dmgUnarchiver) Unarchive(ctx context.Context, logE *logrus.Entry, src * tempFilePath, err := src.Body.Path() if err != nil { - return fmt.Errorf("get a temporal file path: %w", err) + return fmt.Errorf("get a temporary file path: %w", err) } tmpMountPoint, err := afero.TempDir(u.fs, "", "") if err != nil { - return fmt.Errorf("create a temporal file: %w", err) + return fmt.Errorf("create a temporary file: %w", err) } if _, err := u.executor.HdiutilAttach(ctx, tempFilePath, tmpMountPoint); err != nil { if err := u.fs.Remove(tmpMountPoint); err != nil { - logE.WithError(err).Warn("remove a temporal directory created to attach a DMG file") + logE.WithError(err).Warn("remove a temporary directory created to attach a DMG file") } return fmt.Errorf("hdiutil attach: %w", err) } @@ -49,7 +49,7 @@ func (u *dmgUnarchiver) Unarchive(ctx context.Context, logE *logrus.Entry, src * logE.WithError(err).Warn("detach a DMG file") } if err := u.fs.Remove(tmpMountPoint); err != nil { - logE.WithError(err).Warn("remove a temporal directory created to attach a DMG file") + logE.WithError(err).Warn("remove a temporary directory created to attach a DMG file") } }() diff --git a/pkg/unarchive/pkg.go b/pkg/unarchive/pkg.go index abeebb97c..088e0a92f 100644 --- a/pkg/unarchive/pkg.go +++ b/pkg/unarchive/pkg.go @@ -25,7 +25,7 @@ func (u *pkgUnarchiver) Unarchive(ctx context.Context, _ *logrus.Entry, src *Fil tempFilePath, err := src.Body.Path() if err != nil { - return fmt.Errorf("get a temporal file path: %w", err) + return fmt.Errorf("get a temporary file path: %w", err) } if _, err := u.executor.UnarchivePkg(ctx, tempFilePath, u.dest); err != nil { diff --git a/pkg/unarchive/unarchiver.go b/pkg/unarchive/unarchiver.go index 14ddf493f..fb3d16412 100644 --- a/pkg/unarchive/unarchiver.go +++ b/pkg/unarchive/unarchiver.go @@ -18,7 +18,7 @@ type unarchiverWithUnarchiver struct { func (u *unarchiverWithUnarchiver) Unarchive(_ context.Context, _ *logrus.Entry, src *File) error { tempFilePath, err := src.Body.Path() if err != nil { - return fmt.Errorf("get a temporal file: %w", err) + return fmt.Errorf("get a temporary file: %w", err) } return u.unarchiver.Unarchive(tempFilePath, u.dest) //nolint:wrapcheck }