Skip to content

Commit

Permalink
cli/command/image/build_buildkit.go:450:56: parseSSH - result 1 (erro…
Browse files Browse the repository at this point in the history
…r) is always nil (unparam)

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
  • Loading branch information
silvin-lubecki authored and thaJeztah committed Oct 31, 2019
1 parent 0ce2eae commit 28ac2f8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cli/command/image/build_buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,22 +476,19 @@ func parseSecret(value string) (*secretsprovider.FileSource, error) {
func parseSSHSpecs(sl []string) (session.Attachable, error) {
configs := make([]sshprovider.AgentConfig, 0, len(sl))
for _, v := range sl {
c, err := parseSSH(v)
if err != nil {
return nil, err
}
c := parseSSH(v)
configs = append(configs, *c)
}
return sshprovider.NewSSHAgentProvider(configs)
}

func parseSSH(value string) (*sshprovider.AgentConfig, error) {
func parseSSH(value string) *sshprovider.AgentConfig {
parts := strings.SplitN(value, "=", 2)
cfg := sshprovider.AgentConfig{
ID: parts[0],
}
if len(parts) > 1 {
cfg.Paths = strings.Split(parts[1], ",")
}
return &cfg, nil
return &cfg
}

0 comments on commit 28ac2f8

Please sign in to comment.