chore: upgraded golangci-lint v1.52.2 and fixed all issues.

This commit is contained in:
Xavier Michelon
2023-05-04 21:24:17 +02:00
parent bd47303074
commit b51d85e768
26 changed files with 105 additions and 128 deletions

View File

@ -58,11 +58,7 @@ func moveFile(from, to string) error {
return err
}
if err := os.Rename(from, to); err != nil {
return err
}
return nil
return os.Rename(from, to)
}
func copyDir(from, to string) error {

View File

@ -144,13 +144,13 @@ func (testUpdater *TestUpdater) SetLatestVersion(version, minAuto *semver.Versio
}
}
func (testUpdater *TestUpdater) GetVersionInfo(ctx context.Context, downloader updater.Downloader, channel updater.Channel) (updater.VersionInfo, error) {
func (testUpdater *TestUpdater) GetVersionInfo(_ context.Context, _ updater.Downloader, _ updater.Channel) (updater.VersionInfo, error) {
testUpdater.lock.RLock()
defer testUpdater.lock.RUnlock()
return testUpdater.latest, nil
}
func (testUpdater *TestUpdater) InstallUpdate(ctx context.Context, downloader updater.Downloader, update updater.VersionInfo) error {
func (testUpdater *TestUpdater) InstallUpdate(_ context.Context, _ updater.Downloader, _ updater.VersionInfo) error {
return nil
}

View File

@ -72,7 +72,7 @@ func (s *smtpSession) Logout() error {
return nil
}
func (s *smtpSession) Mail(from string, opts *smtp.MailOptions) error {
func (s *smtpSession) Mail(from string, _ *smtp.MailOptions) error {
s.from = from
return nil
}

View File

@ -709,6 +709,6 @@ func TestBridge_User_Refresh(t *testing.T) {
}
// getErr returns the error that was passed to it.
func getErr[T any](val T, err error) error {
func getErr[T any](_ T, err error) error {
return err
}