Skip to content

Commit

Permalink
SA4023 staticcheck fixes (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Feb 14, 2024
1 parent a0eb0b9 commit edbb083
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ee/desktop/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,13 @@ func New(k types.Knapsack, messenger runnerserver.Messenger, opts ...desktopUser
}()

if runtime.GOOS == "darwin" {
osversion, err := osversion()
runner.osVersion, err = osversion()

Check failure on line 197 in ee/desktop/runner/runner.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA4023(related information): the lhs of the comparison is the 2nd return value of this function call (staticcheck)

Check failure on line 197 in ee/desktop/runner/runner.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA4023(related information): the lhs of the comparison is the 2nd return value of this function call (staticcheck)
if err != nil {

Check failure on line 198 in ee/desktop/runner/runner.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA4023: this comparison is always true (staticcheck)

Check failure on line 198 in ee/desktop/runner/runner.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA4023: this comparison is always true (staticcheck)
runner.slogger.Log(context.TODO(), slog.LevelError,
"getting os version",
"err", err,
)
}
runner.osVersion = osversion
}

setInstance(runner)
Expand Down Expand Up @@ -880,7 +879,7 @@ func (r *DesktopUsersProcessesRunner) checkOsUpdate() {
return
}

osVersion, err := osversion()
currentOsVersion, err := osversion()

Check failure on line 882 in ee/desktop/runner/runner.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA4023(related information): the lhs of the comparison is the 2nd return value of this function call (staticcheck)

Check failure on line 882 in ee/desktop/runner/runner.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA4023(related information): the lhs of the comparison is the 2nd return value of this function call (staticcheck)
if err != nil {

Check failure on line 883 in ee/desktop/runner/runner.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA4023: this comparison is always true (staticcheck)

Check failure on line 883 in ee/desktop/runner/runner.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA4023: this comparison is always true (staticcheck)
r.slogger.Log(context.TODO(), slog.LevelError,
"getting os version",
Expand All @@ -889,13 +888,13 @@ func (r *DesktopUsersProcessesRunner) checkOsUpdate() {
return
}

if osVersion != r.osVersion {
if currentOsVersion != r.osVersion {
r.slogger.Log(context.TODO(), slog.LevelInfo,
"os version changed, restarting desktop",
"old", r.osVersion,
"new", osVersion,
"new", currentOsVersion,
)
r.osVersion = osVersion
r.osVersion = currentOsVersion
r.killDesktopProcesses()
}
}

0 comments on commit edbb083

Please sign in to comment.