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" "context"
"crypto/tls" "crypto/tls"
"encoding/pem" "encoding/pem"
"errors"
"net" "net"
neturl "net/url" neturl "net/url"
"sync" "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 // NewClient creates a new govmomi client for the VSphereConnection obj
func (connection *VSphereConnection) NewClient(ctx context.Context) (*vim25.Client, error) { func (connection *VSphereConnection) NewClient(ctx context.Context) (*vim25.Client, error) {
url, err := soap.ParseURL(net.JoinHostPort(connection.Hostname, connection.Port)) 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()) _, err := connection.NewClient(context.Background())
if err != vclib.ErrCaCertInvalid { if msg := err.Error(); !strings.Contains(msg, "invalid certificate") {
t.Fatalf("ErrCaCertInvalid should have occurred, instead got: %v", err) t.Fatalf("Expected invalid certificate error, got '%s'", msg)
} }
} }