diff --git a/backend/bindings/debug_info.go b/backend/bindings/debug_info.go index 7c73aefb..19f3d564 100644 --- a/backend/bindings/debug_info.go +++ b/backend/bindings/debug_info.go @@ -55,12 +55,12 @@ func addFactoryGameLog(writer *zip.Writer) error { if runtime.GOOS == "windows" { cacheDir, err := os.UserCacheDir() if err != nil { - return errors.Wrap(err, "Failed to get user cache dir") + return errors.Wrap(err, "failed to get user cache dir") } err = utils.AddFileToZip(writer, path.Join(cacheDir, "FactoryGame", "Saved", "Logs", "FactoryGame.log"), "FactoryGame.log") if err != nil { if !os.IsNotExist(err) { - return errors.Wrap(err, "Failed to add file to zip") + return errors.Wrap(err, "failed to add file to zip") } } } @@ -99,7 +99,7 @@ func addMetadata(writer *zip.Writer) error { lockfile, err := BindingsInstance.FicsitCLI.GetSelectedInstallLockfile() if err != nil { - return errors.Wrap(err, "Failed to get lockfile") + return errors.Wrap(err, "failed to get lockfile") } metadataInstalledMods := make(map[string]string) @@ -124,17 +124,17 @@ func addMetadata(writer *zip.Writer) error { metadataBytes, err := utils.JSONMarshal(metadata, 2) if err != nil { - return errors.Wrap(err, "Failed to marshal metadata") + return errors.Wrap(err, "failed to marshal metadata") } metadataFile, err := writer.Create("metadata.json") if err != nil { - return errors.Wrap(err, "Failed to create metadata file") + return errors.Wrap(err, "failed to create metadata file") } _, err = metadataFile.Write(metadataBytes) if err != nil { - return errors.Wrap(err, "Failed to write metadata") + return errors.Wrap(err, "failed to write metadata") } return nil } @@ -142,7 +142,7 @@ func addMetadata(writer *zip.Writer) error { func (d *DebugInfo) generateAndSaveDebugInfo(filename string) error { file, err := os.Create(filename) if err != nil { - return errors.Wrap(err, "Failed to create file") + return errors.Wrap(err, "failed to create file") } defer file.Close() writer := zip.NewWriter(file) @@ -150,17 +150,17 @@ func (d *DebugInfo) generateAndSaveDebugInfo(filename string) error { err = addFactoryGameLog(writer) if err != nil { - return errors.Wrap(err, "Failed to add FactoryGame.log to debuginfo zip") + return errors.Wrap(err, "failed to add FactoryGame.log to debuginfo zip") } err = addMetadata(writer) if err != nil { - return errors.Wrap(err, "Failed to add metadata to debuginfo zip") + return errors.Wrap(err, "failed to add metadata to debuginfo zip") } err = utils.AddFileToZip(writer, viper.GetString("log-file"), "SatisfactoryModManager.log") if err != nil { - return errors.Wrap(err, "Failed to add SatisfactoryModManager.log to debuginfo zip") + return errors.Wrap(err, "failed to add SatisfactoryModManager.log to debuginfo zip") } return nil diff --git a/backend/bindings/ficsitcli/installs.go b/backend/bindings/ficsitcli/installs.go index 6259f7da..c3d71b51 100644 --- a/backend/bindings/ficsitcli/installs.go +++ b/backend/bindings/ficsitcli/installs.go @@ -155,8 +155,8 @@ func (f *FicsitCLI) SelectInstall(path string) error { } installation := f.GetInstallation(path) if installation == nil { - l.Error("Failed to find installation") - return errors.New("Installation \"" + path + "\" not found") + l.Error("failed to find installation") + return errors.Errorf("installation %s not found", path) } f.selectedInstallation = installation @@ -178,7 +178,7 @@ func (f *FicsitCLI) SelectInstall(path string) error { installErr := f.validateInstall(f.selectedInstallation, "__select_install__") if installErr != nil { - l.Error("Failed to validate install", slog.Any("error", installErr)) + l.Error("failed to validate install", slog.Any("error", installErr)) return errors.Wrap(installErr, "Failed to validate install") } return nil @@ -194,7 +194,7 @@ func (f *FicsitCLI) GetSelectedInstall() *common.Installation { func (f *FicsitCLI) SetModsEnabled(enabled bool) error { if f.selectedInstallation == nil { slog.Error("no installation selected") - return errors.New("No installation selected") + return errors.New("no installation selected") } l := slog.With(slog.String("task", "setModsEnabled"), slog.Bool("enabled", enabled), utils.SlogPath("install", f.selectedInstallation.Info.Path)) @@ -224,7 +224,7 @@ func (f *FicsitCLI) SetModsEnabled(enabled bool) error { if installErr != nil { l.Error("failed to validate install", slog.Any("error", installErr)) - return errors.Wrap(installErr, "Failed to validate install") + return errors.Wrap(installErr, "failed to validate install") } return nil diff --git a/backend/bindings/ficsitcli/process.go b/backend/bindings/ficsitcli/process.go index 71809a68..0b889947 100644 --- a/backend/bindings/ficsitcli/process.go +++ b/backend/bindings/ficsitcli/process.go @@ -154,7 +154,7 @@ func (f *FicsitCLI) validateInstall(installation *InstallationInfo, progressItem installErr := installation.Installation.Install(f.ficsitCli, installChannel) if installErr != nil { - return errors.Wrap(installErr, "Failed to install") + return errors.Wrap(installErr, "failed to install") } return nil } @@ -195,11 +195,11 @@ func (f *FicsitCLI) EmitGlobals() { func (f *FicsitCLI) InstallMod(mod string) error { if f.progress != nil { - return errors.New("Another operation in progress") + return errors.New("another operation in progress") } if f.selectedInstallation == nil { - return errors.New("No installation selected") + return errors.New("no installation selected") } profileName := f.selectedInstallation.Installation.Profile @@ -207,7 +207,7 @@ func (f *FicsitCLI) InstallMod(mod string) error { profileErr := profile.AddMod(mod, ">=0.0.0") if profileErr != nil { - return errors.Wrapf(profileErr, "Failed to add mod: %s@latest", mod) + return errors.Wrapf(profileErr, "failed to add mod: %s@latest", mod) } f.progress = &Progress{ @@ -223,7 +223,7 @@ func (f *FicsitCLI) InstallMod(mod string) error { installErr := f.validateInstall(f.selectedInstallation, mod) if installErr != nil { - return errors.Wrapf(installErr, "Failed to install mod: %s@latest", mod) + return errors.Wrapf(installErr, "failed to install mod: %s@latest", mod) } _ = f.ficsitCli.Profiles.Save() @@ -233,11 +233,11 @@ func (f *FicsitCLI) InstallMod(mod string) error { func (f *FicsitCLI) InstallModVersion(mod string, version string) error { if f.progress != nil { - return errors.New("Another operation in progress") + return errors.New("another operation in progress") } if f.selectedInstallation == nil { - return errors.New("No installation selected") + return errors.New("no installation selected") } profileName := f.selectedInstallation.Installation.Profile @@ -261,7 +261,7 @@ func (f *FicsitCLI) InstallModVersion(mod string, version string) error { installErr := f.validateInstall(f.selectedInstallation, mod) if installErr != nil { - return errors.Wrapf(installErr, "Failed to install mod: %s@%s", mod, version) + return errors.Wrapf(installErr, "failed to install mod: %s@%s", mod, version) } _ = f.ficsitCli.Profiles.Save() @@ -271,11 +271,11 @@ func (f *FicsitCLI) InstallModVersion(mod string, version string) error { func (f *FicsitCLI) RemoveMod(mod string) error { if f.progress != nil { - return errors.New("Another operation in progress") + return errors.New("another operation in progress") } if f.selectedInstallation == nil { - return errors.New("No installation selected") + return errors.New("no installation selected") } profileName := f.selectedInstallation.Installation.Profile @@ -296,7 +296,7 @@ func (f *FicsitCLI) RemoveMod(mod string) error { installErr := f.validateInstall(f.selectedInstallation, mod) if installErr != nil { - return errors.Wrapf(installErr, "Failed to remove mod: %s", mod) + return errors.Wrapf(installErr, "failed to remove mod: %s", mod) } _ = f.ficsitCli.Profiles.Save() @@ -306,11 +306,11 @@ func (f *FicsitCLI) RemoveMod(mod string) error { func (f *FicsitCLI) EnableMod(mod string) error { if f.progress != nil { - return errors.New("Another operation in progress") + return errors.New("another operation in progress") } if f.selectedInstallation == nil { - return errors.New("No installation selected") + return errors.New("no installation selected") } profileName := f.selectedInstallation.Installation.Profile @@ -331,7 +331,7 @@ func (f *FicsitCLI) EnableMod(mod string) error { installErr := f.validateInstall(f.selectedInstallation, mod) if installErr != nil { - return errors.Wrapf(installErr, "Failed to enable mod: %s", mod) + return errors.Wrapf(installErr, "failed to enable mod: %s", mod) } _ = f.ficsitCli.Profiles.Save() @@ -341,11 +341,11 @@ func (f *FicsitCLI) EnableMod(mod string) error { func (f *FicsitCLI) DisableMod(mod string) error { if f.progress != nil { - return errors.New("Another operation in progress") + return errors.New("another operation in progress") } if f.selectedInstallation == nil { - return errors.New("No installation selected") + return errors.New("no installation selected") } profileName := f.selectedInstallation.Installation.Profile @@ -366,7 +366,7 @@ func (f *FicsitCLI) DisableMod(mod string) error { installErr := f.validateInstall(f.selectedInstallation, mod) if installErr != nil { - return errors.Wrapf(installErr, "Failed to disable mod: %s", mod) + return errors.Wrapf(installErr, "failed to disable mod: %s", mod) } _ = f.ficsitCli.Profiles.Save() diff --git a/backend/bindings/ficsitcli/profiles.go b/backend/bindings/ficsitcli/profiles.go index 7fafe17c..e8d1b8d9 100644 --- a/backend/bindings/ficsitcli/profiles.go +++ b/backend/bindings/ficsitcli/profiles.go @@ -21,7 +21,7 @@ func (f *FicsitCLI) SetProfile(profile string) error { if f.selectedInstallation == nil { l.Error("no installation selected") - return errors.New("No installation selected") + return errors.New("no installation selected") } if f.selectedInstallation.Installation.Profile == profile { return nil @@ -29,7 +29,7 @@ func (f *FicsitCLI) SetProfile(profile string) error { err := f.selectedInstallation.Installation.SetProfile(f.ficsitCli, profile) if err != nil { l.Error("failed to set profile", slog.Any("error", err)) - return errors.Wrap(err, "Failed to set profile") + return errors.Wrap(err, "failed to set profile") } _ = f.ficsitCli.Installations.Save() @@ -81,7 +81,7 @@ func (f *FicsitCLI) AddProfile(name string) error { _, err := f.ficsitCli.Profiles.AddProfile(name) if err != nil { l.Error("failed to add profile", slog.Any("error", err)) - return errors.Wrapf(err, "Failed to add profile: %s", name) + return errors.Wrapf(err, "failed to add profile: %s", name) } _ = f.ficsitCli.Profiles.Save() @@ -97,7 +97,7 @@ func (f *FicsitCLI) RenameProfile(oldName string, newName string) error { err := f.ficsitCli.Profiles.RenameProfile(f.ficsitCli, oldName, newName) if err != nil { l.Error("failed to rename profile", slog.Any("error", err)) - return errors.Wrapf(err, "Failed to rename profile: %s -> %s", oldName, newName) + return errors.Wrapf(err, "failed to rename profile: %s -> %s", oldName, newName) } _ = f.ficsitCli.Profiles.Save() @@ -113,7 +113,7 @@ func (f *FicsitCLI) DeleteProfile(name string) error { err := f.ficsitCli.Profiles.DeleteProfile(name) if err != nil { l.Error("failed to delete profile", slog.Any("error", err)) - return errors.Wrapf(err, "Failed to delete profile: %s", name) + return errors.Wrapf(err, "failed to delete profile: %s", name) } _ = f.ficsitCli.Profiles.Save() @@ -144,24 +144,24 @@ func (f *FicsitCLI) MakeCurrentExportedProfile() (*ExportedProfile, error) { if f.selectedInstallation == nil { l.Error("no installation selected") - return nil, errors.New("No installation selected") + return nil, errors.New("no installation selected") } profileName := f.GetSelectedProfile() if profileName == nil { l.Error("no profile selected") - return nil, errors.New("No profile selected") + return nil, errors.New("no profile selected") } profile := f.GetProfile(*profileName) if profile == nil { l.Error("profile not found", slog.String("profile", *profileName)) - return nil, errors.New("Profile not found") + return nil, errors.New("profile not found") } lockfile, err := f.selectedInstallation.Installation.LockFile(f.ficsitCli) if err != nil { l.Error("failed to get lockfile", slog.Any("error", err)) - return nil, errors.Wrap(err, "Failed to get lockfile") + return nil, errors.Wrap(err, "failed to get lockfile") } metadata := &ExportedProfileMetadata{ GameVersion: f.selectedInstallation.Info.Version, @@ -184,7 +184,7 @@ func (f *FicsitCLI) ExportCurrentProfile() error { exportedProfile, err := f.MakeCurrentExportedProfile() if err != nil { l.Error("failed to make exported profile", slog.Any("error", err)) - return errors.Wrapf(err, "Failed to export profile") + return errors.Wrapf(err, "failed to export profile") } defaultFileName := fmt.Sprintf("%s-%s.smmprofile", exportedProfile.Profile.Name, time.Now().UTC().Format("2006-01-02-15-04-05")) @@ -199,18 +199,18 @@ func (f *FicsitCLI) ExportCurrentProfile() error { }) if err != nil { l.Error("failed to open save dialog", slog.Any("error", err)) - return errors.Wrapf(err, "Failed to export profile: %s", exportedProfile.Profile.Name) + return errors.Wrapf(err, "failed to open save dialog") } exportedProfileJSON, err := utils.JSONMarshal(exportedProfile, 2) if err != nil { l.Error("failed to marshal exported profile", slog.Any("error", err)) - return errors.Wrapf(err, "Failed to export profile: %s", exportedProfile.Profile.Name) + return errors.Wrapf(err, "failed to marshal exported profile") } err = os.WriteFile(filename, exportedProfileJSON, 0o755) if err != nil { l.Error("failed to write exported profile", slog.Any("error", err)) - return errors.Wrapf(err, "Failed to export profile: %s", exportedProfile.Profile.Name) + return errors.Wrapf(err, "failed to write exported profile") } return nil @@ -222,14 +222,14 @@ func (f *FicsitCLI) ReadExportedProfileMetadata(file string) (*ExportedProfileMe fileBytes, err := os.ReadFile(file) if err != nil { l.Error("failed to read exported profile", slog.Any("error", err)) - return nil, errors.Wrap(err, "Failed to read exported profile") + return nil, errors.Wrap(err, "failed to read exported profile") } var exportedProfile ExportedProfile err = json.Unmarshal(fileBytes, &exportedProfile) if err != nil { l.Error("failed to unmarshal exported profile", slog.Any("error", err)) - return nil, errors.Wrap(err, "Failed to read exported profile") + return nil, errors.Wrap(err, "failed to parse exported profile") } return exportedProfile.Metadata, nil @@ -240,26 +240,26 @@ func (f *FicsitCLI) ImportProfile(name string, file string) error { if f.selectedInstallation == nil { l.Error("no installation selected") - return errors.New("No installation selected") + return errors.New("no installation selected") } profileData, err := os.ReadFile(file) if err != nil { l.Error("failed to read exported profile", slog.Any("error", err)) - return errors.Wrap(err, "Failed to read profile file") + return errors.Wrap(err, "failed to read profile file") } var exportedProfile ExportedProfile err = json.Unmarshal(profileData, &exportedProfile) if err != nil { l.Error("failed to unmarshal exported profile", slog.Any("error", err)) - return errors.Wrap(err, "Failed to read profile file") + return errors.Wrap(err, "failed to read profile file") } profile, err := f.ficsitCli.Profiles.AddProfile(name) if err != nil { l.Error("failed to add profile", slog.Any("error", err)) - return errors.Wrap(err, "Failed to add imported profile") + return errors.Wrap(err, "failed to add imported profile") } profile.Mods = exportedProfile.Profile.Mods @@ -270,7 +270,7 @@ func (f *FicsitCLI) ImportProfile(name string, file string) error { if err != nil { _ = f.ficsitCli.Profiles.DeleteProfile(name) l.Error("failed to write lockfile", slog.Any("error", err)) - return errors.Wrap(err, "Failed to write profile") + return errors.Wrap(err, "failed to write profile") } f.EmitGlobals() diff --git a/backend/bindings/ficsitcli/update.go b/backend/bindings/ficsitcli/update.go index 97712ac4..a7c8f86b 100644 --- a/backend/bindings/ficsitcli/update.go +++ b/backend/bindings/ficsitcli/update.go @@ -24,7 +24,7 @@ func (f *FicsitCLI) CheckForUpdates() ([]Update, error) { currentLockfile, err := f.selectedInstallation.Installation.LockFile(f.ficsitCli) if err != nil { l.Error("failed to get current lockfile", slog.Any("error", err)) - return nil, errors.Wrap(err, "Failed to get current lockfile") + return nil, errors.Wrap(err, "failed to get current lockfile") } if currentLockfile == nil { @@ -38,7 +38,7 @@ func (f *FicsitCLI) CheckForUpdates() ([]Update, error) { gameVersion, err := f.selectedInstallation.Installation.GetGameVersion(f.ficsitCli) if err != nil { l.Error("failed to get game version", slog.Any("error", err)) - return nil, errors.Wrap(err, "Failed to get game version") + return nil, errors.Wrap(err, "failed to get game version") } updateProfile := &cli.Profile{ @@ -79,11 +79,11 @@ func (f *FicsitCLI) UpdateMods(mods []string) error { if f.progress != nil { l.Error("another operation in progress") - return errors.New("Another operation in progress") + return errors.New("another operation in progress") } if f.selectedInstallation == nil { - return errors.New("No installation selected") + return errors.New("no installation selected") } profile := f.GetProfile(f.selectedInstallation.Installation.Profile) diff --git a/backend/installfinders/launchers/epic/epic.go b/backend/installfinders/launchers/epic/epic.go index 3435ee05..c5948197 100644 --- a/backend/installfinders/launchers/epic/epic.go +++ b/backend/installfinders/launchers/epic/epic.go @@ -70,7 +70,7 @@ func findInstallationsEpic(epicManifestsPath string, launcher string, launchPath manifests, err := os.ReadDir(epicManifestsPath) if err != nil { - return nil, []error{errors.Wrap(err, "Failed to list Epic manifests")} + return nil, []error{errors.Wrap(err, "failed to list Epic manifests")} } installs := make([]*common.Installation, 0) @@ -86,13 +86,13 @@ func findInstallationsEpic(epicManifestsPath string, launcher string, launchPath manifestData, err := os.ReadFile(manifestPath) if err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to read Epic manifest %s", manifestName)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to read Epic manifest %s", manifestName)) continue } var epicManifest Manifest if err := json.Unmarshal(manifestData, &epicManifest); err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to parse Epic manifest %s", manifestName)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to parse Epic manifest %s", manifestName)) continue } @@ -106,13 +106,13 @@ func findInstallationsEpic(epicManifestsPath string, launcher string, launchPath gameManifestPath := processPath(filepath.Join(epicManifest.ManifestLocation, gameManifestName)) gameManifestData, err := os.ReadFile(gameManifestPath) if err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to read Epic game manifest %s", gameManifestName)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to read Epic game manifest %s", gameManifestName)) continue } var epicGameManifest GameManifest if err := json.Unmarshal(gameManifestData, &epicGameManifest); err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to parse Epic game manifest %s", gameManifestName)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to parse Epic game manifest %s", gameManifestName)) continue } @@ -121,7 +121,7 @@ func findInstallationsEpic(epicManifestsPath string, launcher string, launchPath epicGameManifest.AppName != epicManifest.MainGameAppName { findErrors = append(findErrors, common.InstallFindError{ Path: installLocation, - Inner: errors.New("Mismatching manifest data"), + Inner: errors.New("mismatching manifest data"), }) continue } @@ -149,13 +149,13 @@ func findInstallationsEpic(epicManifestsPath string, launcher string, launchPath versionFile, err := os.ReadFile(versionFilePath) if err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to read version file %s", versionFilePath)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to read version file %s", versionFilePath)) continue } var versionData GameVersionFile if err := json.Unmarshal(versionFile, &versionData); err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to parse version file %s", versionFilePath)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to parse version file %s", versionFilePath)) continue } diff --git a/backend/installfinders/launchers/steam/steam.go b/backend/installfinders/launchers/steam/steam.go index 9284b96a..2060d057 100644 --- a/backend/installfinders/launchers/steam/steam.go +++ b/backend/installfinders/launchers/steam/steam.go @@ -20,13 +20,13 @@ func findInstallationsSteam(steamPath string, launcher string, executable []stri libraryFoldersF, err := os.Open(libraryFoldersManifestPath) if err != nil { - return nil, []error{errors.Wrap(err, "Failed to open library folders manifest")} + return nil, []error{errors.Wrap(err, "failed to open library folders manifest")} } parser := vdf.NewParser(libraryFoldersF) libraryFoldersManifest, err := parser.Parse() if err != nil { - return nil, []error{errors.Wrap(err, "Failed to parse library folders manifest")} + return nil, []error{errors.Wrap(err, "failed to parse library folders manifest")} } var libraryFoldersList map[string]interface{} @@ -36,7 +36,7 @@ func findInstallationsSteam(steamPath string, launcher string, executable []stri } else if _, ok := libraryFoldersManifest["libraryfolders"]; ok { libraryFoldersList = libraryFoldersManifest["libraryfolders"].(map[string]interface{}) } else { - return nil, []error{errors.New("Failed to find library folders in manifest")} + return nil, []error{errors.New("failed to find library folders in manifest")} } libraryFolders := []string{ @@ -75,14 +75,14 @@ func findInstallationsSteam(steamPath string, launcher string, executable []stri manifestF, err := os.Open(manifestPath) if err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to open manifest file %s", manifestPath)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to open manifest file %s", manifestPath)) continue } parser := vdf.NewParser(manifestF) manifest, err := parser.Parse() if err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to parse manifest file %s", manifestPath)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to parse manifest file %s", manifestPath)) continue } @@ -97,7 +97,7 @@ func findInstallationsSteam(steamPath string, launcher string, executable []stri if _, err := os.Stat(gameExe); os.IsNotExist(err) { findErrors = append(findErrors, common.InstallFindError{ Path: fullInstallationPath, - Inner: errors.Wrap(err, "Missing game executable"), + Inner: errors.Wrap(err, "missing game executable"), }) continue } @@ -106,20 +106,20 @@ func findInstallationsSteam(steamPath string, launcher string, executable []stri if _, err := os.Stat(versionFilePath); os.IsNotExist(err) { findErrors = append(findErrors, common.InstallFindError{ Path: fullInstallationPath, - Inner: errors.Wrap(err, "Missing game version file"), + Inner: errors.Wrap(err, "missing game version file"), }) continue } versionFile, err := os.ReadFile(versionFilePath) if err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to read version file %s", versionFilePath)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to read version file %s", versionFilePath)) continue } var versionData epic.GameVersionFile if err := json.Unmarshal(versionFile, &versionData); err != nil { - findErrors = append(findErrors, errors.Wrapf(err, "Failed to parse version file %s", versionFilePath)) + findErrors = append(findErrors, errors.Wrapf(err, "failed to parse version file %s", versionFilePath)) continue } diff --git a/backend/installfinders/launchers/steam/steam_windows.go b/backend/installfinders/launchers/steam/steam_windows.go index 5f66dccd..45367576 100644 --- a/backend/installfinders/launchers/steam/steam_windows.go +++ b/backend/installfinders/launchers/steam/steam_windows.go @@ -12,7 +12,7 @@ import ( func FindInstallations() ([]*common.Installation, []error) { key, err := registry.OpenKey(registry.CURRENT_USER, `Software\Valve\Steam`, registry.QUERY_VALUE) if err != nil { - return nil, []error{errors.Wrap(err, "Failed to open Steam registry key")} + return nil, []error{errors.Wrap(err, "failed to open Steam registry key")} } defer key.Close() diff --git a/backend/utils/zip.go b/backend/utils/zip.go index 80ff14d1..9966d018 100644 --- a/backend/utils/zip.go +++ b/backend/utils/zip.go @@ -11,22 +11,22 @@ import ( func AddFileToZip(writer *zip.Writer, path string, zipPath string) error { file, err := os.Open(path) if err != nil { - return errors.Wrap(err, "Failed to open file") + return errors.Wrap(err, "failed to open file") } defer file.Close() fileInfo, err := file.Stat() if err != nil { - return errors.Wrap(err, "Failed to get file info") + return errors.Wrap(err, "failed to get file info") } if fileInfo.IsDir() { - return errors.New("File is a directory") + return errors.New("file is a directory") } header, err := zip.FileInfoHeader(fileInfo) if err != nil { - return errors.Wrap(err, "Failed to create header") + return errors.Wrap(err, "failed to create header") } header.Method = zip.Deflate @@ -34,9 +34,9 @@ func AddFileToZip(writer *zip.Writer, path string, zipPath string) error { fileWriter, err := writer.CreateHeader(header) if err != nil { - return errors.Wrap(err, "Failed to create file writer") + return errors.Wrap(err, "failed to create file writer") } _, err = io.Copy(fileWriter, file) - return errors.Wrap(err, "Failed to copy file") + return errors.Wrap(err, "failed to copy file") } diff --git a/main.go b/main.go index b0f2012b..1b873da1 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ var projectFile []byte func loadProjectFile() error { err := json.Unmarshal(projectFile, &projectfile.ProjectFile) if err != nil { - return errors.Wrap(err, "Failed to load project file") + return errors.Wrap(err, "failed to load project file") } return nil }