} else {
san += fmt.Sprintf(",DNS:%s", super.ListenHost)
}
- if hostname, err := os.Hostname(); err != nil {
+ hostname, err := os.Hostname()
+ if err != nil {
return fmt.Errorf("hostname: %w", err)
- } else {
- san += ",DNS:" + hostname
}
+ san += ",DNS:" + hostname
// Generate root key
- err := super.RunProgram(ctx, super.tempdir, runOptions{}, "openssl", "genrsa", "-out", "rootCA.key", "4096")
+ err = super.RunProgram(ctx, super.tempdir, runOptions{}, "openssl", "genrsa", "-out", "rootCA.key", "4096")
if err != nil {
return err
}
PasswordCallback: func(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) {
if c.User() == "_" {
return nil, nil
- } else {
- return nil, fmt.Errorf("cannot specify user %q via ssh client", c.User())
}
+ return nil, fmt.Errorf("cannot specify user %q via ssh client", c.User())
},
PublicKeyCallback: func(c ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error) {
if c.User() == "_" {
"pubkey-fp": ssh.FingerprintSHA256(pubKey),
},
}, nil
- } else {
- return nil, fmt.Errorf("cannot specify user %q via ssh client", c.User())
}
+ return nil, fmt.Errorf("cannot specify user %q via ssh client", c.User())
},
}
pvt, err := rsa.GenerateKey(rand.Reader, 2048)
if c.APIHost == "" {
if c.loadedFromEnv {
return errors.New("ARVADOS_API_HOST and/or ARVADOS_API_TOKEN environment variables are not set")
- } else {
- return errors.New("arvados.Client cannot perform request: APIHost is not set")
}
+ return errors.New("arvados.Client cannot perform request: APIHost is not set")
}
urlString := c.apiURL(path)
urlValues, err := anythingToValues(params)