Skip to content

Commit 7422403

Browse files
authored
Merge pull request #49885 from mmorel-35/fix-staticcheck
fix staticcheck linting issues for golangci-lint v2
2 parents a10a1e6 + 09a3c93 commit 7422403

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

cli/command/image/build/internal/git/gitutils_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,15 @@ func TestCheckoutGit(t *testing.T) {
216216
server := httptest.NewServer(&githttp)
217217
defer server.Close()
218218

219-
autocrlf := gitGetConfig("core.autocrlf")
220-
if !(autocrlf == "true" || autocrlf == "false" ||
221-
autocrlf == "input" || autocrlf == "") {
222-
t.Logf("unknown core.autocrlf value: \"%s\"", autocrlf)
223-
}
224219
eol := "\n"
225-
if autocrlf == "true" {
220+
autocrlf := gitGetConfig("core.autocrlf")
221+
switch autocrlf {
222+
case "true":
226223
eol = "\r\n"
224+
case "false", "input", "":
225+
// accepted values
226+
default:
227+
t.Logf(`unknown core.autocrlf value: "%s"`, autocrlf)
227228
}
228229

229230
must := func(out []byte, err error) {

0 commit comments

Comments
 (0)