cli/command/image/build_buildkit.go:450:56: parseSSH - result 1 (error) is always nil (unparam)

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
Silvin Lubecki 2019-04-02 13:16:13 +02:00 committed by Sebastiaan van Stijn
parent 0ce2eae5a2
commit 28ac2f82c6
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 3 additions and 6 deletions

View File

@ -476,16 +476,13 @@ func parseSecret(value string) (*secretsprovider.FileSource, error) {
func parseSSHSpecs(sl []string) (session.Attachable, error) { func parseSSHSpecs(sl []string) (session.Attachable, error) {
configs := make([]sshprovider.AgentConfig, 0, len(sl)) configs := make([]sshprovider.AgentConfig, 0, len(sl))
for _, v := range sl { for _, v := range sl {
c, err := parseSSH(v) c := parseSSH(v)
if err != nil {
return nil, err
}
configs = append(configs, *c) configs = append(configs, *c)
} }
return sshprovider.NewSSHAgentProvider(configs) return sshprovider.NewSSHAgentProvider(configs)
} }
func parseSSH(value string) (*sshprovider.AgentConfig, error) { func parseSSH(value string) *sshprovider.AgentConfig {
parts := strings.SplitN(value, "=", 2) parts := strings.SplitN(value, "=", 2)
cfg := sshprovider.AgentConfig{ cfg := sshprovider.AgentConfig{
ID: parts[0], ID: parts[0],
@ -493,5 +490,5 @@ func parseSSH(value string) (*sshprovider.AgentConfig, error) {
if len(parts) > 1 { if len(parts) > 1 {
cfg.Paths = strings.Split(parts[1], ",") cfg.Paths = strings.Split(parts[1], ",")
} }
return &cfg, nil return &cfg
} }