mirror of https://github.com/docker/cli.git
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 <github@gone.nl>
This commit is contained in:
parent
a269e17d72
commit
7c4b63b1c3
|
@ -117,6 +117,7 @@ var testKeys = map[string][]byte{
|
||||||
func TestLoadKeyFromPath(t *testing.T) {
|
func TestLoadKeyFromPath(t *testing.T) {
|
||||||
skip.If(t, runtime.GOOS == "windows")
|
skip.If(t, runtime.GOOS == "windows")
|
||||||
for keyID, keyBytes := range testKeys {
|
for keyID, keyBytes := range testKeys {
|
||||||
|
keyID, keyBytes := keyID, keyBytes
|
||||||
t.Run(fmt.Sprintf("load-key-id-%s-from-path", keyID), func(t *testing.T) {
|
t.Run(fmt.Sprintf("load-key-id-%s-from-path", keyID), func(t *testing.T) {
|
||||||
testLoadKeyFromPath(t, keyID, keyBytes)
|
testLoadKeyFromPath(t, keyID, keyBytes)
|
||||||
})
|
})
|
||||||
|
@ -172,6 +173,7 @@ func testLoadKeyFromPath(t *testing.T, privKeyID string, privKeyFixture []byte)
|
||||||
func TestLoadKeyTooPermissive(t *testing.T) {
|
func TestLoadKeyTooPermissive(t *testing.T) {
|
||||||
skip.If(t, runtime.GOOS == "windows")
|
skip.If(t, runtime.GOOS == "windows")
|
||||||
for keyID, keyBytes := range testKeys {
|
for keyID, keyBytes := range testKeys {
|
||||||
|
keyID, keyBytes := keyID, keyBytes
|
||||||
t.Run(fmt.Sprintf("load-key-id-%s-too-permissive", keyID), func(t *testing.T) {
|
t.Run(fmt.Sprintf("load-key-id-%s-too-permissive", keyID), func(t *testing.T) {
|
||||||
testLoadKeyTooPermissive(t, keyBytes)
|
testLoadKeyTooPermissive(t, keyBytes)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue