1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-15 01:34:26 +02:00

Enable errorlint linter, and fix warnings

This commit is contained in:
Stefan Haller
2025-06-30 11:11:35 +02:00
parent 0471dbaa84
commit 7aa426fa71
6 changed files with 17 additions and 17 deletions

View File

@ -2,6 +2,7 @@ package git_config
import (
"bytes"
"errors"
"fmt"
"io"
"os/exec"
@ -39,7 +40,8 @@ func runGitConfigCmd(cmd *exec.Cmd) (string, error) {
cmd.Stderr = io.Discard
err := cmd.Run()
if exitError, ok := err.(*exec.ExitError); ok {
var exitError *exec.ExitError
if errors.As(err, &exitError) {
if waitStatus, ok := exitError.Sys().(syscall.WaitStatus); ok {
if waitStatus.ExitStatus() == 1 {
return "", fmt.Errorf("the key is not found for %s", cmd.Args)