From 0a21de05d2c712439bf053dfb108b2930730d399 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 29 Oct 2019 09:59:48 +0100 Subject: [PATCH] compose/loader: fix TestIsAbs not testing all combinations This test was intending to run all tests, but didn't, which was caught by golangci-lint; cli/compose/loader/windows_path_test.go:46:17: SA4010: this result of append is never used, except maybe in other appends (staticcheck) tests := append(isabstests, winisabstests...) ^ Signed-off-by: Sebastiaan van Stijn --- cli/compose/loader/windows_path_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/compose/loader/windows_path_test.go b/cli/compose/loader/windows_path_test.go index d612d41733..e3c821ee2f 100644 --- a/cli/compose/loader/windows_path_test.go +++ b/cli/compose/loader/windows_path_test.go @@ -43,7 +43,8 @@ var winisabstests = []IsAbsTest{ } func TestIsAbs(t *testing.T) { - tests := append(isabstests, winisabstests...) + tests := winisabstests + // All non-windows tests should fail, because they have no volume letter. for _, test := range isabstests { tests = append(tests, IsAbsTest{test.path, false}) @@ -53,7 +54,7 @@ func TestIsAbs(t *testing.T) { tests = append(tests, IsAbsTest{"c:" + test.path, test.isAbs}) } - for _, test := range winisabstests { + for _, test := range tests { if r := isAbs(test.path); r != test.isAbs { t.Errorf("IsAbs(%q) = %v, want %v", test.path, r, test.isAbs) }