Remove unused exported errors

This commit is contained in:
Hannes Hörl 2018-06-24 11:15:13 +01:00
parent 37e8c17041
commit a536ebc580
2 changed files with 2 additions and 8 deletions

View File

@ -20,7 +20,6 @@ import (
"context"
"crypto/tls"
"encoding/pem"
"errors"
"net"
neturl "net/url"
"sync"
@ -148,11 +147,6 @@ func (connection *VSphereConnection) Logout(ctx context.Context) {
}
}
var (
ErrCaCertNotReadable = errors.New("Could not read CA cert file")
ErrCaCertInvalid = errors.New("Could not parse CA cert file")
)
// NewClient creates a new govmomi client for the VSphereConnection obj
func (connection *VSphereConnection) NewClient(ctx context.Context) (*vim25.Client, error) {
url, err := soap.ParseURL(net.JoinHostPort(connection.Hostname, connection.Port))

View File

@ -180,8 +180,8 @@ func TestInvalidCaCert(t *testing.T) {
_, err := connection.NewClient(context.Background())
if err != vclib.ErrCaCertInvalid {
t.Fatalf("ErrCaCertInvalid should have occurred, instead got: %v", err)
if msg := err.Error(); !strings.Contains(msg, "invalid certificate") {
t.Fatalf("Expected invalid certificate error, got '%s'", msg)
}
}