Remove redundant nil check
From the Go docs: "For a nil slice, the number of iterations is 0." [1] Both `info.RootFS` and `host.clientPairs` are slices. Therefore, an additional nil check for before the loop is unnecessary. [1]: https://go.dev/ref/spec#For_range Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
		@@ -275,7 +275,6 @@ func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...N
 | 
				
			|||||||
			return nil, err
 | 
								return nil, err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if info.RootFS != nil {
 | 
					 | 
				
			||||||
	for _, m := range info.RootFS {
 | 
						for _, m := range info.RootFS {
 | 
				
			||||||
		request.Rootfs = append(request.Rootfs, &types.Mount{
 | 
							request.Rootfs = append(request.Rootfs, &types.Mount{
 | 
				
			||||||
			Type:    m.Type,
 | 
								Type:    m.Type,
 | 
				
			||||||
@@ -284,7 +283,6 @@ func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...N
 | 
				
			|||||||
			Options: m.Options,
 | 
								Options: m.Options,
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	request.RuntimePath = info.RuntimePath
 | 
						request.RuntimePath = info.RuntimePath
 | 
				
			||||||
	if info.Options != nil {
 | 
						if info.Options != nil {
 | 
				
			||||||
		o, err := typeurl.MarshalAny(info.Options)
 | 
							o, err := typeurl.MarshalAny(info.Options)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -193,7 +193,6 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if host.clientPairs != nil {
 | 
					 | 
				
			||||||
				for _, pair := range host.clientPairs {
 | 
									for _, pair := range host.clientPairs {
 | 
				
			||||||
					certPEMBlock, err := os.ReadFile(pair[0])
 | 
										certPEMBlock, err := os.ReadFile(pair[0])
 | 
				
			||||||
					if err != nil {
 | 
										if err != nil {
 | 
				
			||||||
@@ -216,7 +215,6 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
					tlsConfig.Certificates = append(tlsConfig.Certificates, cert)
 | 
										tlsConfig.Certificates = append(tlsConfig.Certificates, cert)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
				c := *client
 | 
									c := *client
 | 
				
			||||||
				c.Transport = tr
 | 
									c.Transport = tr
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user