From f7b23cf5728de75f19514e73c4489f9ff44b7c03 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 29 Oct 2019 13:42:59 +0100 Subject: [PATCH] cli/command/trust: Using the variable on range scope `keyBytes` in function literal (scopelint) ``` cli/command/trust/key_load_test.go:121:27: Using the variable on range scope `keyID` in function literal (scopelint) testLoadKeyFromPath(t, keyID, keyBytes) ^ cli/command/trust/key_load_test.go:176:32: Using the variable on range scope `keyBytes` in function literal (scopelint) testLoadKeyTooPermissive(t, keyBytes) ^ ``` Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 7c4b63b1c3d81dc1fa8b13802a41d677e54a742d) Signed-off-by: Sebastiaan van Stijn --- cli/command/trust/key_load_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/command/trust/key_load_test.go b/cli/command/trust/key_load_test.go index e0e35aab9b..b8c89f1cd5 100644 --- a/cli/command/trust/key_load_test.go +++ b/cli/command/trust/key_load_test.go @@ -117,6 +117,7 @@ var testKeys = map[string][]byte{ func TestLoadKeyFromPath(t *testing.T) { skip.If(t, runtime.GOOS == "windows") for keyID, keyBytes := range testKeys { + keyID, keyBytes := keyID, keyBytes t.Run(fmt.Sprintf("load-key-id-%s-from-path", keyID), func(t *testing.T) { testLoadKeyFromPath(t, keyID, keyBytes) }) @@ -172,6 +173,7 @@ func testLoadKeyFromPath(t *testing.T, privKeyID string, privKeyFixture []byte) func TestLoadKeyTooPermissive(t *testing.T) { skip.If(t, runtime.GOOS == "windows") for keyID, keyBytes := range testKeys { + keyID, keyBytes := keyID, keyBytes t.Run(fmt.Sprintf("load-key-id-%s-too-permissive", keyID), func(t *testing.T) { testLoadKeyTooPermissive(t, keyBytes) })