diff --git a/.golangci.yml b/.golangci.yml index 63b19c205..00bc78837 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,6 +15,7 @@ linters: - sqlclosecheck - unconvert - paralleltest + - revive disable: - errcheck - gosec @@ -32,6 +33,13 @@ linters-settings: ignore: github.com/go-kit/kit/log:Log gofmt: simplify: false + revive: + rules: + - name: superfluous-else + severity: warning + disabled: false + arguments: + - "preserveScope" issues: exclude-rules: diff --git a/cmd/launcher/main.go b/cmd/launcher/main.go index df7222fec..26a6ed4d7 100644 --- a/cmd/launcher/main.go +++ b/cmd/launcher/main.go @@ -75,9 +75,9 @@ func main() { logutil.Fatal(logger, err, "exec") } panic("how") - } else { - level.Debug(logger).Log("msg", "Nothing new") } + + level.Debug(logger).Log("msg", "Nothing new") } } diff --git a/ee/desktop/runner/runner_linux.go b/ee/desktop/runner/runner_linux.go index 5373bee14..789e9d498 100644 --- a/ee/desktop/runner/runner_linux.go +++ b/ee/desktop/runner/runner_linux.go @@ -126,9 +126,6 @@ func (r *DesktopUsersProcessesRunner) userEnvVars(ctx context.Context, uid strin envVars["DISPLAY"] = r.displayFromXwayland(ctx, int32(uidInt)) break - } else { - // Not a graphical session - continue } }